DEV Community

Joey Umanito
Joey Umanito

Posted on

10 Must-Have APIs for Every Developer (With Python Code Examples)

Every developer needs a set of go-to APIs that make building faster and easier. Here are 10 must-have APIs that I use in almost every project, with code examples for each.

1. OpenWeatherMap API (Free)

Get real-time weather data for any location.

import requests

def get_weather(city):
    url = f"https://api.openweathermap.org/data/2.5/weather"
    params = {"q": city, "appid": "YOUR_KEY", "units": "metric"}
    response = requests.get(url, params=params)
    data = response.json()
    return f"{city}: {data['main']['temp']}C, {data['weather'][0]['description']}"

print(get_weather("Kuala Lumpur"))
Enter fullscreen mode Exit fullscreen mode

Free tier: 60 calls/minute, 1000 calls/day

2. News API (Free Tier)

Get latest news from thousands of sources.

import requests

def get_news(topic):
    url = "https://newsapi.org/v2/everything"
    params = {"q": topic, "apiKey": "YOUR_KEY", "pageSize": 5}
    response = requests.get(url, params=params)
    articles = response.json()["articles"]
    return [{"title": a["title"], "url": a["url"]} for a in articles]

news = get_news("artificial intelligence")
for item in news:
    print(item["title"])
Enter fullscreen mode Exit fullscreen mode

Free tier: 100 requests/day

3. ExchangeRates API (Free)

Real-time currency exchange rates.

import requests

def convert_currency(amount, from_currency, to_currency):
    url = f"https://api.exchangerate-api.com/v4/latest/{from_currency}"
    response = requests.get(url)
    rates = response.json()["rates"]
    return amount * rates[to_currency]

usd_to_myr = convert_currency(100, "USD", "MYR")
print(f"100 USD = {usd_to_myr:.2f} MYR")
Enter fullscreen mode Exit fullscreen mode

Free tier: 1500 requests/month

4. IP Geolocation API (Free)

Get location data from an IP address.

import requests

def get_location(ip):
    response = requests.get(f"https://ipapi.co/{ip}/json/")
    data = response.json()
    return f"{data['city']}, {data['country_name']}"

location = get_location("8.8.8.8")
print(f"IP Location: {location}")
Enter fullscreen mode Exit fullscreen mode

Free tier: 1000 requests/day

5. QR Code Generator API (Free)

Generate QR codes for any text or URL.

import requests

def generate_qr(data, filename="qr.png"):
    url = f"https://api.qrserver.com/v1/create-qr-code/?size=200x200&data={data}"
    response = requests.get(url)
    with open(filename, "wb") as f:
        f.write(response.content)
    return filename

qr_file = generate_qr("https://fiverr.com/joeyumanito")
print(f"QR code saved: {qr_file}")
Enter fullscreen mode Exit fullscreen mode

Completely free, no API key needed!

6. Random User Generator (Free)

Generate fake user data for testing.

import requests

def generate_users(count=5):
    response = requests.get(f"https://randomuser.me/api/?results={count}")
    users = response.json()["results"]
    return [{
        "name": f"{u['name']['first']} {u['name']['last']}",
        "email": u["email"],
        "country": u["location"]["country"]
    } for u in users]

test_users = generate_users(3)
for user in test_users:
    print(user)
Enter fullscreen mode Exit fullscreen mode

Free, no API key needed!

7. Text Summarizer API (RapidAPI - Free Tier)

Summarize long texts with AI.

import requests

def summarize(text):
    url = "https://ai-text-summarizer5.p.rapidapi.com/summarize"
    headers = {
        "X-RapidAPI-Key": "YOUR_KEY",
        "X-RapidAPI-Host": "ai-text-summarizer5.p.rapidapi.com"
    }
    response = requests.post(url, json={"text": text}, headers=headers)
    return response.json().get("summary", "")

summary = summarize("Your long article text here...")
print(summary)
Enter fullscreen mode Exit fullscreen mode

Try it free: https://rapidapi.com/joeyumanito/api/ai-text-summarizer5

8. Email Validator API (RapidAPI - Free Tier)

Validate email addresses before sending.

import requests

def validate_email(email):
    url = "https://email-validator-pro2.p.rapidapi.com/validate"
    headers = {
        "X-RapidAPI-Key": "YOUR_KEY",
        "X-RapidAPI-Host": "email-validator-pro2.p.rapidapi.com"
    }
    response = requests.get(url, params={"email": email}, headers=headers)
    return response.json()

result = validate_email("test@example.com")
print("Valid:", result.get("is_valid"))
Enter fullscreen mode Exit fullscreen mode

Try it free: https://rapidapi.com/joeyumanito/api/email-validator-pro2

9. GitHub API (Free)

Access any public GitHub data.

import requests

def get_repo_stats(owner, repo):
    url = f"https://api.github.com/repos/{owner}/{repo}"
    response = requests.get(url)
    data = response.json()
    return {
        "stars": data["stargazers_count"],
        "forks": data["forks_count"],
        "language": data["language"]
    }

stats = get_repo_stats("python", "cpython")
print(stats)
Enter fullscreen mode Exit fullscreen mode

Free: 60 requests/hour (5000 with auth)

10. Dictionary API (Free)

Get word definitions, synonyms, and more.

import requests

def define_word(word):
    response = requests.get(f"https://api.dictionaryapi.dev/api/v2/entries/en/{word}")
    data = response.json()[0]
    definition = data["meanings"][0]["definitions"][0]["definition"]
    return f"{word}: {definition}"

print(define_word("algorithm"))
Enter fullscreen mode Exit fullscreen mode

Completely free, no API key!

Bonus: Combine Multiple APIs

Here is a practical example combining weather and news:

def daily_briefing(city, topic):
    weather = get_weather(city)
    news = get_news(topic)[:3]

    briefing = f"Good morning!\n\nWeather: {weather}\n\nTop {topic} news:\n"
    for i, item in enumerate(news, 1):
        briefing += f"{i}. {item['title']}\n"

    return briefing

print(daily_briefing("Kuala Lumpur", "technology"))
Enter fullscreen mode Exit fullscreen mode

Need Custom API Integration?

Need a specific API integrated into your project? I can help with:

  • REST API development and integration
  • Bot development for Telegram and WhatsApp
  • AI-powered automation systems

Check out my Fiverr gigs:


Which API is your favorite? Let me know in the comments!

Top comments (0)