The Horoscope API provides daily horoscopes for all zodiac signs.
https://api.api-ninjas.com/v1/horoscope
Returns the daily horoscope for a specific zodiac sign.
zodiac
requiredThe zodiac sign to get a horoscope for. Valid values are: aries, taurus, gemini, cancer, leo, virgo, libra, scorpio, sagittarius, capricorn, aquarius, pisces.
X-Api-Key
requiredAPI Key associated with your account.
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.
https://api.api-ninjas.com/v1/horoscope?zodiac=virgo
Headers
X-Api-Key
Log in or sign up to get your API Key
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."
}
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.