You need to fetch a horoscope for a specific sun sign on a specific date and wire it into your app this week. By the end of this guide, you’ll be able to retrieve today’s and past horoscopes by date, list supported signs/timeframes, and pull today/weekly/monthly entries—using production-ready endpoints on Zyla API Hub.
What this API does and when to use it
The Horoscope API on Zyla API Hub provides programmatic access to horoscope text for sun signs across multiple timeframes. It supports:
- Retrieving a horoscope for a specific date (today or past) using a YYYY-MM-DD date.
- Fetching daily, weekly, monthly, and day-of-week horoscopes by timeframe.
- Listing supported sun signs and timeframes, so your UI can validate inputs and avoid user errors.
Common integrations include daily notifications, chatbots, personal dashboards, and content widgets that need deterministic access to a particular day’s horoscope.
Getting started on Zyla API Hub
Open the Horoscope API page on Zyla API Hub and subscribe to get your API key. Access is subscription-based with quotas (not pay-per-call), and you can start with a 7-day trial on the listing page. You’ll send requests with the header Authorization: Bearer YOUR_API_KEY.
API listing: Start 7-day trial on Horoscope API
You can browse thousands of other ready-to-use APIs on the hub as well: Zyla API Hub.
Endpoints you will use
1) Get Symbols
Check the supported sun signs and timeframes to validate user input and configure your UI controls.
- Method: GET
- URL: https://zylalabs.com/api/891/horoscope-api/2450/get-symbols
- Parameters: none documented
- Auth: Authorization: Bearer YOUR_API_KEY
curl -s -X GET "https://zylalabs.com/api/891/horoscope-api/694/get-horoscope?sunsign=gemini&timeframe=daily" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"status": 200,
"success": true,
"sunSigns": "gemini",
"timeFrames": "daily",
"Horoscope": "September 2, 2026 - Is it time to serve up those walking papers? With the moon in your twelfth house of healing and closure, the moment has come to cut ties with a toxic situation. That's never as easy as it sounds, so lean on the people who have your back, whether that’s a relative or a member of your chosen family. The moon is forming a supportive trine to Mercury in your homey fourth house, which puts self-care near the top of your priorities today. Considering a move? Scroll the listings on your lunch break, but sleep on anything that requires a signature."
}
Use this to populate dropdowns and validate values before calling other endpoints.
2) Get Horoscope
Retrieve today’s, weekly, monthly, or day-of-week horoscopes by specifying a sun sign and timeframe.
- Method: GET
- URL: https://zylalabs.com/api/891/horoscope-api/694/get-horoscope
- Required parameters:
- sunsign (string): e.g., gemini
- timeframe (string): e.g., daily
- Auth: Authorization: Bearer YOUR_API_KEY
Fields you’ll typically use: - sunSigns: the sun sign you requested - timeFrames: the timeframe you requested - Horoscope: the text content for display or processing
3) By Date
Retrieve a horoscope for a specific date (including today or a past date) for a given sun sign. This is the core endpoint when you need “API for by date.”
- Method: GET
- URL: https://zylalabs.com/api/891/horoscope-api/3527/by-date
- Required parameters:
- sunsign (string): e.g., gemini
- date (string): e.g., 2024-01-02 (format YYYY-MM-DD)
- Auth: Authorization: Bearer YOUR_API_KEY
Fields you’ll typically use: - sunSigns: the sun sign you requested - date: the date you requested (YYYY-MM-DD) - Horoscope: the text content for that date
Python example for By Date
This sample calls the By Date endpoint and prints the returned fields. Replace YOUR_API_KEY with your key from the listing page.
import requests
API_KEY = "YOUR_API_KEY"
url = "https://zylalabs.com/api/891/horoscope-api/3527/by-date"
params = {
"sunsign": "gemini",
"date": "2024-01-02"
}
headers = {
"Authorization": f"Bearer {API_KEY}"
}
resp = requests.get(url, params=params, headers=headers, timeout=15)
resp.raise_for_status()
data = resp.json()
if data.get("success"):
print("Sun sign:", data.get("sunSigns"))
print("Date:", data.get("date"))
print("Horoscope:", data.get("Horoscope"))
else:
print("Request did not succeed:", data)
Implementation notes that save time
- Date format: pass date in YYYY-MM-DD for the By Date endpoint (e.g., 2024-01-02).
- Input validation: call Get Symbols at startup to populate and validate sun signs and timeframes. This reduces 400/422-type errors from invalid inputs.
- Caching: if you serve many users the same content (e.g., the same sign and date), cache responses to minimize redundant calls and speed up page loads.
- Response handling: check success and status fields before using Horoscope text. Log non-success payloads for troubleshooting.
- Auth: always send Authorization: Bearer YOUR_API_KEY on each request.
- Usage model: Zyla APIs use subscription plans with quotas (not pay-per-call). The listing page shows current access options, including a 7-day trial for this API.
Practical use cases
- Daily card in a mobile app: show today’s horoscope by timeframe with Get Horoscope, and let users view the previous days with By Date.
- Email digests: build a digest that includes yesterday and today for a selected sign; fetch each via By Date.
- Chatbot fallback: if a user asks, “What was Gemini on 2024-01-02?”, route to By Date and return the exact text.
- Content archive: store By Date responses so users can browse historical entries for their sign.
- Widget embedding: pre-validate signs/timeframes once via Get Symbols, then call By Date for deterministic history.
Calling the API from AI agents via MCP
You can call Zyla APIs from MCP-compatible clients (e.g., Claude Code, Cursor, Windsurf) using the MCP endpoint. Provide your API key in the query string when initializing the tool:
Endpoint for agents: https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY
Learn more about MCP here: MCP. Once configured, prompt your agent to call the By Date endpoint with the required sunsign and date parameters, or to fetch Get Symbols first to validate inputs.
End-to-end flow example
- On app start, call Get Symbols to retrieve sunSigns and timeFrames. Cache them for form validation.
- When a user requests a specific date, call By Date with sunsign and date in YYYY-MM-DD.
- If a user requests “today,” either call By Date with today’s date or use Get Horoscope with timeframe=daily.
- Display data.Horoscope. Optionally show the requested sunSigns and date/timeFrames to confirm context to the user.
- Cache results per (sunsign, date/timeframe) key to reduce repeat calls.
Security and operations checklist
- Store YOUR_API_KEY securely (environment variables or your secrets manager).
- Set timeouts on HTTP requests to fail fast and degrade gracefully.
- Log non-200 HTTP statuses and payloads where success is false for debugging.
- If you pre-render pages, batch calls and reuse cached responses to stay within plan quotas.
Reference: copy-ready cURL requests
Get Symbols (supported signs and timeframes):
Get Horoscope (timeframe-based):
By Date (specific day):
FAQ
Which date format does By Date require?
Use YYYY-MM-DD (for example, 2024-01-02) in the date parameter.
How do I know which sun signs and timeframes are valid?
Call the Get Symbols endpoint to retrieve the authoritative lists of sunSigns and timeFrames, then validate user input against those arrays.
Can I retrieve today’s horoscope by date and by timeframe?
Yes. For a specific calendar day, use By Date with today’s date. For a “today” experience without specifying a date, use Get Horoscope with timeframe=daily.
What’s the authentication method?
Send Authorization: Bearer YOUR_API_KEY in the request header for all endpoints.
Is pricing pay-per-call?
No. Zyla APIs use subscription plans with quotas. Check the API page for current access options and pricing.
Ship your “by date” integration now: open the listing, start the 7-day trial, and get your key. Start 7-day trial on Horoscope API. Explore more APIs anytime on Zyla API Hub.