API Documentation
Base URL: https://fakeapi.dev/api/v1
Getting Started
No authentication required for GET requests. Just hit the endpoint and receive JSON.
# curl curl "https://fakeapi.dev/api/v1/users?per_page=5"
All responses follow this envelope shape:
{
"success": true,
"data": [...],
"meta": {
"total": 1000,
"page": 1,
"per_page": 10,
"total_pages": 100,
"has_more": true
}
}
Users
Returns paginated list of fake users.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number (default: 1) |
| per_page | integer | Results per page (max 100) |
| locale | string | en_US, pl_PL, ar_SA, hi_IN, fr_FR |
| gender | string | male or female |
| search | string | Search first_name, last_name, email |
| fields | string | Comma-separated fields to return |
| sort_by | string | id, first_name, last_name, email, created_at |
| sort_dir | string | asc or desc |
Get a single user by ID.
Get paginated posts for a user.
Get paginated orders for a user.
Echo back a new user (nothing written to DB).
Echo back updated user data.
Echo deletion success.
Products
Returns paginated list of products with category.
| Param | Type | Description |
|---|---|---|
| category | string | Category slug (electronics, clothing, etc.) |
| min_price | number | Minimum price filter |
| max_price | number | Maximum price filter |
| brand | string | Brand name filter |
| availability | string | in_stock, low_stock, out_of_stock |
| min_rating | number | Minimum rating (1–5) |
| search | string | Search by title |
| sort_by | string | id, price, rating, title, created_at |
Search products by title or brand with ?q=term.
| Param | Type | Description |
|---|---|---|
| q | string | Search query |
Get a single product by ID.
Get paginated reviews for a product.
Categories
Returns all product categories with product count.
Get a single category by slug.
Get paginated products in a category.
Orders
Returns paginated list of orders.
| Param | Type | Description |
|---|---|---|
| status | string | pending, processing, shipped, delivered, cancelled |
| payment_status | string | paid, pending, failed |
| user_id | integer | Filter by user ID |
Get a single order by ID.
Posts
Returns paginated list of posts.
| Param | Type | Description |
|---|---|---|
| user_id | integer | Filter by author |
| visibility | string | public, friends, private |
| sort_by | string | id, likes_count, comments_count, created_at |
Get paginated comments on a post.
Reviews
Returns paginated list of reviews.
| Param | Type | Description |
|---|---|---|
| product_id | integer | Filter by product ID |
| min_rating | number | Minimum rating (1–5) |
| max_rating | number | Maximum rating (1–5) |
Get a single review by ID.
Countries
Returns paginated list of countries with ISO codes, flags, currencies, phone codes and coordinates.
| Param | Type | Description |
|---|---|---|
| region | string | Africa, Americas, Asia, Europe, Oceania |
| subregion | string | Southern Asia, Western Europe, etc. |
| currency | string | ISO 4217 currency code (USD, EUR, GBP…) |
| search | string | Search by name, iso2 or iso3 |
| sort_by | string | id, name, population, area_km2 |
Get a single country by ISO2, ISO3 or numeric ID.
Get paginated cities for a country.
| Param | Type | Description |
|---|---|---|
| capitals_only | boolean | Return only capital cities (true/false) |
| sort_by | string | id, name, population |
Cities
Returns paginated list of cities with coordinates, timezone and population.
| Param | Type | Description |
|---|---|---|
| country | string | ISO2 or ISO3 country code |
| timezone | string | IANA timezone (e.g. America/New_York) |
| capitals_only | boolean | Return only capital cities |
| search | string | Search by city name |
| sort_by | string | id, name, population |
Get a single city by ID (includes nested country).
Regions & Timezones
Returns all geographic regions and subregions with country/population aggregates.
Returns all IANA timezones with UTC offset.
Companies
Returns paginated list of companies with industry, size, revenue, tech stack and benefits.
| Param | Type | Description |
|---|---|---|
| industry | string | Technology, Finance, Healthcare, Retail… |
| type | string | public, private, nonprofit, government |
| size | string | 1-10, 11-50, 51-200, 201-500, 501-1000, 1000+ |
| country | string | Filter by headquarters country |
| search | string | Search by name, industry, description |
| sort_by | string | id, name, founded, rating, employee_count, annual_revenue_usd |
Get a single company by ID or slug.
Get departments belonging to a company.
Get employees at a company.
| Param | Type | Description |
|---|---|---|
| department | string | Filter by department name |
| level | string | junior, mid, senior, lead, manager, director, vp, c-level |
Get open job listings for a company.
Employees
Returns paginated list of employees with company, department, salary, skills and hire date.
| Param | Type | Description |
|---|---|---|
| level | string | junior, mid, senior, lead, manager, director, vp, c-level |
| employment_type | string | full-time, part-time, contract, intern |
| status | string | active, inactive, on-leave, terminated |
| remote | boolean | true or false |
| search | string | Search by name, job title, email |
| sort_by | string | id, first_name, last_name, salary, hire_date |
Get a single employee (includes company and department).
Echo a new employee (nothing written to DB).
Echo updated employee data.
Echo deletion success.
Jobs
Returns paginated open job listings with salary ranges, required skills and company info.
| Param | Type | Description |
|---|---|---|
| level | string | junior, mid, senior, lead, manager, director |
| employment_type | string | full-time, part-time, contract, intern |
| remote | boolean | true or false |
| status | string | open (default), closed, paused, draft |
| min_salary | number | Minimum salary_min filter |
| max_salary | number | Maximum salary_max filter |
| search | string | Search by title, description |
| sort_by | string | id, title, salary_min, salary_max, posted_at, applicants_count |
Get a single job by ID or slug (includes company and department).
Echo a new job listing (nothing written to DB).
Echo updated job data.
Echo deletion success.
Departments
Returns paginated list of departments with headcount and budget.
| Param | Type | Description |
|---|---|---|
| search | string | Search by department name |
Get a single department by ID (includes company).
Charges (Payments)
Stripe-inspired payment charges with status, fee breakdown, refund and dispute flags.
Returns paginated list of payment charges with nested payment method and user.
| Param | Type | Description |
|---|---|---|
| status | string | pending, succeeded, failed, refunded, disputed |
| currency | string | USD, EUR, GBP… |
| min_amount | number | Minimum charge amount |
| max_amount | number | Maximum charge amount |
| disputed | boolean | true or false |
| sort_by | string | id, amount, created_at, paid_at |
Get a single charge by ID.
Echo a new charge with fee and net calculation (nothing written to DB).
| Param | Type | Description |
|---|---|---|
| amount | number | Required. Charge amount (min 0.50) |
| currency | string | ISO 4217 code (default: USD) |
| user_id | integer | Required. |
Payment Methods
Returns paginated list of saved payment methods (cards, bank accounts, wallets).
| Param | Type | Description |
|---|---|---|
| type | string | card, bank_account, paypal, apple_pay, google_pay |
Get a single payment method by ID.
Invoices
Returns paginated invoices with line items, tax, discount, billing info and payment status.
| Param | Type | Description |
|---|---|---|
| status | string | draft, open, paid, void, uncollectible |
| currency | string | USD, EUR, GBP… |
| sort_by | string | id, total, due_date, created_at |
Get a single invoice by ID or invoice number (e.g. INV-000042).
Echo a new invoice with automatic subtotal/tax/total calculation (nothing written to DB).
| Param | Type | Description |
|---|---|---|
| user_id | integer | Required. |
| line_items | array | Required. Array of {description, quantity, unit_price} |
Subscriptions
Returns paginated subscriptions with plan details, billing cycle, trial and cancellation info.
| Param | Type | Description |
|---|---|---|
| status | string | active, trialing, past_due, canceled, unpaid, paused |
| plan | string | Filter by plan name (starter, pro, business, enterprise…) |
| interval | string | month or year |
| sort_by | string | id, amount, created_at, current_period_end |
Get a single subscription by ID or subscription_id (sub_xxxx).
Echo cancel at period end (nothing written to DB).
Coupons
Returns paginated list of discount coupons.
| Param | Type | Description |
|---|---|---|
| active | boolean | true or false |
| discount_type | string | percent or fixed |
Get a coupon by code (e.g. SAVE20) or ID.
Validate a coupon — checks active status, expiry and redemption limit.
Webhooks
Simulate Stripe-style webhook deliveries to any URL you control. Useful for testing webhook handlers, middleware, and signature verification without a live integration.
Every delivery includes an X-FakeAPI-Signature header with a Stripe-compatible HMAC-SHA256 signature: t={timestamp},v1={hash}.
Returns the full list of supported event types.
Delivers a signed fake webhook payload to the URL you provide. Returns the HTTP status and body your server responded with.
| Param | Type | Description |
|---|---|---|
| url | string | Required. The HTTPS endpoint to POST to |
| event | string | Required. One of the supported event types (see /webhooks/events) |
# Simulate a payment.succeeded event curl -X POST "https://fakeapi.dev/api/v1/webhooks/simulate" \ -H "Content-Type: application/json" \ -d '{"url":"https://your-server.com/webhook","event":"payment.succeeded"}'
Supported event types:
payment.succeeded payment.failed payment.refunded invoice.paid invoice.payment_failed subscription.created subscription.canceled subscription.updated user.created order.created order.shipped order.delivered coupon.redeemed
GraphQL
A lightweight GraphQL-compatible read API — no external packages, built from scratch. Supports field selection, filtering, pagination, and nested relations. Base URL: https://fakeapi.dev/api/graphql
Send queries via GET with ?query={...} or POST with a JSON body {"query":"..."}.
Execute a GraphQL query via query string.
| Param | Type | Description |
|---|---|---|
| query | string | The GraphQL query |
| delay | integer | Optional response delay in ms |
Execute a GraphQL query via JSON body.
| Param | Type | Description |
|---|---|---|
| query | string | Required. The GraphQL query |
Returns the full schema — all 34 query types with their filters and available relations.
Example queries:
# Select specific fields, filter + paginate { users(per_page: 5, locale: "en_US") { id first_name email } } # Nested relations { products(category: "electronics", per_page: 3) { id title price category { name slug } } } # Multiple top-level queries in one request { users(per_page: 2) { id first_name } products(per_page: 2) { id title price } countries(region: "Asia") { name iso2 } } # Single record lookup { user(id: 1) { id first_name last_name email } product(id: 5) { id title price brand } }
All 34 available query types: users user products product categories category orders order posts post comments comment reviews review countries country cities city companies company departments department employees employee jobs job payments payment paymentMethods invoices invoice subscriptions subscription coupons coupon
Responses follow the standard GraphQL envelope: {"data":{...},"errors":[...]}. List queries include a meta key with pagination info. Use the GraphQL Explorer → to try it interactively.
Global Query Parameters
| Parameter | Example | Description |
|---|---|---|
| page | ?page=2 | Page number |
| per_page | ?per_page=25 | Results per page (max 100) |
| delay | ?delay=2000 | Simulate slow network (ms, max 5000) |
| fields | ?fields=id,name,email | Return only specified fields |
| sort_by | ?sort_by=price | Field to sort by |
| sort_dir | ?sort_dir=desc | asc or desc |
| api_key | ?api_key=xxx | Your API key for higher limits |
Rate Limiting
100 requests / hour per IP address. No signup needed.
1,000 requests / hour with a free API key. Get yours →
Rate limit headers on every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Comments
Returns paginated list of comments.
Get a single comment by ID.