FakerAPI Documentation
Documentation Link: https://fakerapi.it/
The FakerAPI provides dummy data endpoints for various resources (Addresses, Books, Users, etc.) suitable for testing, prototyping, and demonstrating application logic.
Prepared by:
Md. Ebrahim Hossain
SQA Engineer at Achieve Test Prep (Newark, US)
Source API: fakerapi.it
Base URL Pattern
The API uses a dynamic base URL structure:
https://fakerapi.it/api/{version}
Note: All requests are GET requests and parameters control the number of generated objects.
General Data Endpoints (GET)
1. Persons Data
/v2/persons?_quantity=1&_gender=female&_birthday_start=2005-01-01
Status Code: 200
Request Example (Female, Post-2005 DOB)
GET /api/v2/persons?_quantity=1&_gender=female&_birthday_start=2005-01-01 HTTP/1.1
Optional Parameters
Parameters:
- `_gender`: Filter by gender (`male`, `female`).
- `_birthday_start`: Min date for birthday (`Y-m-d`). Default: -90 years.
- `_birthday_end`: Max date for birthday (`Y-m-d`). Default: now.
Response (200 OK - Female Example)
HTTP/1.1 200 OK { "status": "OK", "total": 1, "data": [ { "id": 1, "firstname": "Cheyanne", "lastname": "Hickle", "birthday": "2024-08-07", "gender": "female", ... address, website, image ... } ] }
2. Products Data
/v2/products?_quantity=1&_taxes=12&_categories_type=uuid
Status Code: 200
Request Example (Custom Taxes and Categories)
GET /api/v2/products?_quantity=1&_taxes=12&_categories_type=uuid HTTP/1.1
Optional Parameters
Parameters:
- `_price_min`: Minimum price (e.g., `20.50`).
- `_price_max`: Maximum price (e.g., `10320.99`).
- `_taxes`: Tax percentage (e.g., `12`). Default: 22.
- `_categories_type`: Category ID format (`integer`, `string`, `uuid`). Default: integer.
Response (200 OK - 12% Tax Example)
HTTP/1.1 200 OK { "status": "OK", "data": [ { "id": 1, "name": "Itaque veritatis...", "net_price": 3298.11, "taxes": 12, "price": 3693.88, "categories": [ "b37f2e10-a0b7..." ] ... } ] }
3. Users Data
/v1/users?_quantity=1
Status Code: 200
Request Example (1 User)
GET /api/v1/users?_quantity=1 HTTP/1.1
Response (200 OK - Excerpt)
HTTP/1.1 200 OK { "data": [ { "id": 1, "firstname": "Alice", "lastname": "Jones", "username": "alice.j", "email": "alice.j@fakerapi.it" } ] }
4. Texts Data
/v2/texts?_quantity=1&_characters=500
Status Code: 200
Request Example (500 Characters)
GET https://fakerapi.it/api/v2/texts?_quantity=1&_characters=500 HTTP/1.1
Optional Parameters
`_characters`
- Description: Sets the maximum length (in characters) of the generated content/text.
- Example: `_characters=500`
Response (200 OK - Excerpt)
HTTP/1.1 200 OK { "status": "OK", "total": 1, "data": [ { "title": "Mock Turtle is.'.", "author": "Shayna Prosacco", "content": "Hatter: 'let's all move one place on.' He moved on as he spoke... [content truncated to ~500 chars]." } ] }
5. Companies Data
/v2/companies?_quantity=1
Status Code: 200
Request Example (1 Company)
GET /api/v2/companies?_quantity=1 HTTP/1.1
Response (200 OK - Excerpt)
HTTP/1.1 200 OK { "status": "OK", "total": 1, "data": [ { "id": 1, "name": "O'Conner, Wiegand and Simonis", "email": "dare.celia@fahey.org", "vat": "8555502337", "country": "French Guiana", "addresses": [ ... 5 address objects ... ], "contact": { "firstname": "Gladyce" ... } } ] }
6. Addresses Data
/v2/addresses?_quantity=1&_country_code=FR
Status Code: 200
Request Example (Country Code Filter)
GET /api/v2/addresses?_quantity=1&_country_code=FR HTTP/1.1
Optional Parameters
`_country_code`
- Description: Forces the country of the generated addresses.
- Format: ISO 3166-1 Two-letter code (e.g., `FR`, `DE`, `US`).
Available Locales:
Response (200 OK - Excerpt)
HTTP/1.1 200 OK { "status": "OK", "data": [ { "id": 1, "street": "8051 Juvenal Rue", "city": "Port Mariefort", "zipcode": "26780-2983", "country": "St. Vincent & Grenadines", "country_code": "VC" } ] }
7. Books Data
/v2/books?_quantity=1
Status Code: 200
Request Example (1 Book)
GET /api/v2/books?_quantity=1 HTTP/1.1
Response (200 OK - Excerpt)
HTTP/1.1 200 OK { "status": "OK", "data": [ { "id": 1, "title": "VERY remarkable in.", "author": "Carolyne Braun", "genre": "Earum", "isbn": "9792855454435", "published": "2013-01-07", "publisher": "Ipsa Autem" } ] }
Custom Data Generation
1. Custom Schema Generation
/v1/custom?_quantity=1&...
Status Code: 200
This endpoint allows you to define the exact fields and fake data types you need directly in the query string.
Available Data Formats
| Parameter | Example Value |
|---|---|
| boolean | `true` |
| boolean_digit | `0` |
| buildingNumber | `"53187"` |
| card_expiration | `"02/25"` |
| card_number | `"4556082033886662"` |
| card_type | `"Visa"` |
| city | `"Priceborough"` |
| company_name | `"Schmitt, Gutmann and Bahringer"` |
| counter | `8` |
| country | `"Tonga"` |
| countryCode | `"BO"` |
| date | `"1971-11-13"` |
| dateTime | `{"date": "2002-11-10..."}` |
| ean | `"7532778771811"` |
| `"unique67@swift.biz"` | |
| firstName | `"Jakob"` |
| image | `"http://placeimg.com/..."` |
| lastName | `"Fritsch"` |
| latitude | `-35.512254` |
| longText | `"No accounting for tastes! Sing her "Turtle Soup,"..."` |
| longitude | `14.42684` |
| name | `"Abigale Bode"` |
| null | `null` |
| number | `71306343` |
| phone | `"+1151949349100"` |
| pokemon | `"Prinplup"` |
| postcode | `"20687"` |
| state | `"Pennsylvania"` |
| streetAddress | `"6153 Gabe Forest..."` |
| text | `"Hatter. 'He won't stand beating...."` |
| upc | `"677703563138"` |
| uuid | `"18a374fa-4e69-3c4e-86da-ebc71870b594"` |
| vat | `"0276969273"` |
| website | `"stark.com"` |
| word | `"velit"` |
Response Example (URL: `...custom?_quantity=1&customfield1=name&customfield2=dateTime&customfield3=phone`)
HTTP/1.1 200 OK { "data": [ { "customfield1": "Yadira Lang", "customfield2": { "date": "1978-10-20 07:31:01.000000", "timezone_type": 3, "timezone": "UTC" }, "customfield3": "+19474125622" } ] }