Skip to content
DDataNest

Astrology · 4 min read

How to use the Astrology API in Python & JavaScript

Horoscope content is daily-return traffic gold, but writing it never ends. The Astrology API returns stable, ready-to-display readings from one call.

By DataNest · Published May 2026

What the Astrology API does

Horoscopes for all 12 zodiac signs — daily, weekly and monthly readings with ratings, lucky number, colour, gem and time, full sign profiles, date-to-sign lookup, and compatibility scoring. Stable per day, clean JSON. Responses are JSON, the API runs behind the RapidAPI gateway for auth and rate limiting, and there's a free tier for prototyping.

When to use it

horoscope apps
astrology widgets
compatibility tools

The example request

GET https://astrology-api-by-datanest.p.rapidapi.com/horoscope/leo?sign=leo&day=today

Example JSON response

An illustrative response body — run the live demo for the real thing.

{
  "sign": "Leo",
  "symbol": "♌",
  "date": "2026-05-18",
  "day": "today",
  "horoscope": "Today asks you to trust your instincts. Romance favours the bold — a small gesture goes a long way. A mentor's advice proves unexpectedly valuable.",
  "ratings": {
    "overall": 4,
    "love": 5,
    "career": 3,
    "health": 4,
    "money": 3
  },
  "mood": "Inspired",
  "lucky_number": 27,
  "lucky_color": "Gold",
  "lucky_time": "11:30 AM",
  "lucky_gem": "Ruby",
  "compatible_sign": "Aquarius",
  "element": "Fire",
  "ruling_planet": "Sun"
}

Common parameters

Every request also needs your RapidAPI auth headers.

ParameterInRequiredExample
signpathYesleo
dayqueryYestoday
x-rapidapi-keyheaderYesYOUR_RAPIDAPI_KEY
x-rapidapi-hostheaderYesastrology-api-by-datanest.p.rapidapi.com

Step by step

1. Subscribe and get your key

Open the Astrology API on RapidAPI, subscribe to the free BASIC plan, and copy your X-RapidAPI-Key.

2. Call the endpoint

The example call for this API is shown above. The quick-start snippets below send exactly that request in cURL, Python and Node so you get a real response on the first try.

3. Try it without code first

The Astrology page has a live "Try it" panel — change the input, run it, and inspect the real JSON before you integrate.

4. Integrate and cache

Call it from your backend and cache responses where it makes sense. Most responses change slowly, so even a daily cache keeps you well within the free tier.

Quick-start code

curl --request GET \
  --url 'https://astrology-api-by-datanest.p.rapidapi.com/horoscope/leo?day=today' \
  --header 'x-rapidapi-host: astrology-api-by-datanest.p.rapidapi.com' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY'

What you can build

Daily horoscope app

Show every sign's reading, ratings and lucky picks with one /daily-all call.

Compatibility tool

Score any two signs across love, friendship and communication for a match feature.

Horoscope widget

Embed a stable daily reading on a blog or homepage — same per day, cache-friendly.

Wrapping up

If your project needs horoscope apps, the Astrology API removes the part nobody enjoys building. It's one of 25 in the DataNest collection — grab a free key and make your first call.

Astrology updates

New Astrology guides and endpoint updates, occasionally.