Horoscope API

The Horoscope API provides daily horoscopes for all zodiac signs.

/v1/horoscope GET

https://api.api-ninjas.com/v1/horoscope

Returns the daily horoscope for a specific zodiac sign.


Parameters

  • zodiac  required

    The zodiac sign to get a horoscope for. Valid values are: aries, taurus, gemini, cancer, leo, virgo, libra, scorpio, sagittarius, capricorn, aquarius, pisces.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

Returns a JSON object with the following properties:

  • date

    The date for the horoscope in YYYY-MM-DD format.

  • zodiac

    The zodiac sign the horoscope is for.

  • horoscope

    The daily horoscope text for the specified zodiac sign.

Sample Request Live Demo!

zodiac
https://api.api-ninjas.com/v1/horoscope?zodiac=virgo

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
1 2 3 4 5 { "date": "2023-07-15", "zodiac": "virgo", "horoscope": "Today is a day for careful planning and attention to detail, Virgo. Your analytical skills are heightened, making it an excellent time to tackle complex problems. In your personal relationships, clear communication will prevent misunderstandings. Take some time for self-care and don't be too critical of yourself or others. A small act of kindness could have unexpected positive results." }

Code Examples

1 2 3 4 5 6 7 8 import requests api_url = 'https://api.api-ninjas.com/v1/horoscope?zodiac=virgo' response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'}) if response.status_code == requests.codes.ok: print(response.text) else: print("Error:", response.status_code, response.text)

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.