Types of APIs
- RESTful APIs: queries for static information at current moment (e.g. user profiles, posts, etc.)
- Streaming APIs: real time data (e.g. new tweets, weather alerts…)
- APIs often have extensive documentation:
- Written for developers, so must be understandable for humans
- What to look for: endpoints and parameters.
- e.g., DeepL API Documentation
- Most APIs are rate-limited:
- Restrictions on number of API calls by user/IP address and period of time.
- Commercial APIs may impose a monthly fee
- List of APIs in case you need inspiration (see also here)
- Be respectful
- Rate-limit your requests (
sys.sleep()
in loop)
- Identify yourself (
GET(url, user_agent("me@gmail.com thank you"))
or token/key)