Python client for JSONPlaceholder — the free fake REST API for testing and prototyping. No API key needed.
from jsonplaceholder import JSONPlaceholderClient
client = JSONPlaceholderClient()
# Get all posts
posts = client.posts()
print(f"{len(posts)} posts")
# Get specific post
post = client.post(1)
print(f"{post['title']}")
# Get comments for a post
comments = client.comments(post_id=1)
print(f"{len(comments)} comments on post 1")
# Get user
user = client.user(1)
print(f"{user['name']} — {user['email']}")
# Create a post (fake, returns 201)
new = client.create_post(title="Hello", body="World", user_id=1)
print(f"Created post #{new['id']}")| Method | Description | Count |
|---|---|---|
posts() / post(id) |
Blog posts | 100 |
comments(post_id) |
Post comments | 500 |
users() / user(id) |
User profiles | 10 |
todos() / todo(id) |
Todo items | 200 |
albums() / album(id) |
Photo albums | 100 |
photos(album_id) |
Album photos | 5000 |
- Learning REST APIs — perfect for beginners
- Testing HTTP clients — mock API for your app
- Prototyping — build UI before backend is ready
- CI/CD testing — predictable API responses
- Teaching — classroom exercises
- github-api-python — GitHub API client
- awesome-no-auth-apis — 50+ free APIs
MIT
I build production-ready scrapers, APIs, and data tools — 78+ deployed on Apify, 270+ open-source repos.
📧 spinov001@gmail.com — $250 flat rate, 48h delivery. Describe your project, get a free estimate in 2 hours.