Skip to content

Zapier

Automate astrology tasks with Zapier and Occult API.

Code by Zapier

Add a Code by Zapier action (Python or JavaScript) to call Occult API.

Python Example

python
import requests

sign = input_data.get('sign', 'aries')
response = requests.post(
    'https://api.occultapi.com/api/astro/rashifal/daily/',
    headers={
        'X-API-Key': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={'rashi': sign}
)
data = response.json()
results = [{'horoscope': data['data']['get_daily_rashifal']['general_prediction']}]

JavaScript Example

javascript
const sign = inputData.sign || 'aries';
const response = await fetch(`https://api.occultapi.com/api/astro/rashifal/daily/`, {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ rashi: sign }),
});
const data = await response.json();
return [{ horoscope: data.data.get_daily_rashifal.general_prediction }];

Example Zap

Schedule (every Monday) → Code by Zapier (get daily horoscope) → Send Slack message with the result.