Dify
Integrate Occult API into Dify workflows for AI-powered astrology applications.
HTTP Tool
In Dify, add an HTTP tool node. Set method to POST and URL to https://api.occultapi.com/api/astro/chart/.
Headers
Add X-API-Key with your Occult API key and Content-Type: application/json.
{
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}Body
Pass birth data as JSON body variables from previous nodes.
{
"date_time": "1990-05-15T14:30:00+05:30",
"latitude": 28.6139,
"longitude": 77.209,
"timezone_as_float": 5.5
}Workflow Example
Create a chatflow where the user provides birth data, the HTTP node calls Occult API, and a response node formats the result.
{
"nodes": [
{
"type": "start",
"data": { "variables": ["date_time", "latitude", "longitude"] }
},
{
"type": "http-request",
"data": {
"method": "POST",
"url": "https://api.occultapi.com/api/astro/chart/",
"headers": {
"X-API-Key": "={{$env.OCCULT_API_KEY}}",
"Content-Type": "application/json"
},
"body": {
"date_time": "={{start.date_time}}",
"latitude": "={{start.latitude}}",
"longitude": "={{start.longitude}}",
"timezone_as_float": 5.5
}
}
},
{
"type": "llm",
"data": {
"prompt": "Format this natal chart data into a readable summary: {{http.body}}"
}
}
]
}