The problem
A client wanted daily horoscopes on their wellness app. All 12 signs, refreshed daily, English first with Hindi coming in phase two. The deadline was end of week. I did not want to spend three days reading documentation for an API I had never used.
Here is the stack I ended up with, and the working Python you can drop into a project today.
What I used
DivineAPI for the horoscope endpoint
Python 3.11
The requests library (pip install requests)
About 10 minutes of actual work
Step 1: Get your API key
Sign up at divineapi.com, 14-day free trial, you will need a credit card to register. Once you are in the dashboard, grab your API key. Two things they hand you that you will need:
The api_key value (goes in the request body)
An Authorization token (goes in the header as Bearer {token})
Yes, two separate auth bits. I did not catch this on first read and spent ten minutes wondering why I was getting 401s.…