Code Monkey home page Code Monkey logo

horoscope-api's Introduction

Horoscope API - DivineAPI

Start your FREE Trial to get your API KEY, https://divineapi.com

Travis Docs Maintenance yes SayThanks Paypal

divineapi logo

What is Horoscope API?

With divine API, developers can add astrology services to the desired apps. Divine API - Horoscope API gives user an option to view fortune related features of the present, previous and the coming days.

Why Horoscope API?

Divine API’s Horoscope API is best-in-class horoscope API services which let customers choose their own zodiac sign and reading through the 6 categories - Personal Life, Emotions, Profession, Health, Travel & Luck. With Data in the format of today, tomorrow and yesterday.

The divine API is for those who want to add astrology or horoscope related services to their websites. Divine API will let your customers peep into what they can expect from their personal, professional and social life everyday.

Features

  • Horoscope API tells you about your profession in a given day.
  • It provides the users with health tips depending on their zodiac signs.
  • People will get to know what would their emotions bring to the surface.
  • Travel horoscope is an amazing feature provided to the user.
  • It gives all the users cosmic tips, tips to singles and couples.

Benefits

  • It will tell you how your day is going to be.
  • The Horoscope API display what color and numbers are lucky for you in a given day.
  • Knowing that stars are in preferred position will help your confidence blossom.

URL

POST: https://divineapi.com/api/1.0/get_daily_horoscope.php

Parameters

api_key :
Your API KEY.
sign :

Name of the sign.

List of all signs - aries, taurus, gemini, cancer, leo, virgo, libra, scorpio, sagittarius, capricorn, aquarius and pisces.

date :

Current Date in Y-m-d Format (Ex: 2020-12-25)

Date can be today,tomorrow or yesterday

Result Example:

{
    "success": 1,
    "message": "Prediction data.",
    "data": {
        "sign": "ARIES",
        "prediction": {
            "personal": "Personal Life",
            "health": "Health",
            "profession": "Profession",
            "emotions": "Emotions",
            "travel": "Travel",
            "luck": [
                "Colors of the day – Green, Pink",
                "Lucky Numbers of the day – 5, 9",
                "Lucky Alphabets you will be in sync with – B, D",
                "Cosmic Tip – Opinions do not define you.",
                "Tips for singles – Take pride in being perfectly imperfect. ",
                "Tips for couples – It is already yours, try to maintain that."
            ]
        }
    }
}

Example

The following example is for sun sign aries -

cURL

curl -d "api_key=YOUR_API_KEY&date=YYYY-MM-DD&sign=aries" -X POST https://divineapi.com/api/1.0/get_daily_horoscope.php

Python

import requests
from requests.structures import CaseInsensitiveDict

url = "https://divineapi.com/api/1.0/get_daily_horoscope.php"

headers = CaseInsensitiveDict()
headers["Content-Type"] = "application/x-www-form-urlencoded"

data = "api_key=YOUR_API_KEY&date=YYYY-MM-DD&sign=aries"


resp = requests.post(url, headers=headers, data=data)

print(resp.status_code)

Javascript

var url = "https://divineapi.com/api/1.0/get_daily_horoscope.php";

var xhr = new XMLHttpRequest();
xhr.open("POST", url);

xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};

var data = "api_key=YOUR_API_KEY&date=YYYY-MM-DD&sign=aries";

xhr.send(data);

PHP

<?php
 $url = "https://divineapi.com/api/1.0/get_daily_horoscope.php";

 $curl = curl_init($url);
 curl_setopt($curl, CURLOPT_URL, $url);
 curl_setopt($curl, CURLOPT_POST, true);
 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

 $headers = array(
    "Content-Type: application/x-www-form-urlencoded",
 );
 curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

 $data = "api_key=YOUR_API_KEY&date=YYYY-MM-DD&sign=aries";

 curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

 $resp = curl_exec($curl);
 curl_close($curl);
 var_dump($resp);
?>

jQuery Ajax

 $.ajax({
type:'POST',
url:'https://divineapi.com/api/1.0/get_daily_horoscope.php',
data: {api_key:'YOUR_API_KEY', date: 'YYYY-MM-DD', sign:'aries'},
success:function(data){
console.log(data);
}
 });

ECMAScript (ES6)

const URL = 'https://divineapi.com/api/1.0/get_daily_horoscope.php?api_key=YOUR_API_KEY&sign=aries&day=YYYY-MM-DD';
fetch(URL, {
    method: 'POST'
})
.then(response => response.json())
.then(json => {
    const date = json.current_date;
    console.log(date);
});

Services

Horoscope Daily Tarot Yes No Tarot Fortune Cookie Coffee Cup

License

2021 Divine API

Licensed under the Apache License, Version 2.0 (the "License");

http://www.apache.org/licenses/LICENSE-2.0

Contact

Questions? Suggestions? Feel free to contact me at [email protected]

Credits

Source of horoscope updates - http://divineapi.com/horoscope-api/

Please feel free to use and adapt this awesome API.

horoscope-api's People

Contributors

divineapi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.