An API REST to fake any other one.
Make an HTTP request with search params like status, body, header, or delay to get the response you want.
GET https://faker.deno.dev/?body=hola&delay=1000&status=400 HTTP/1.1 400 Bad Request content-type: text/plain content-length: 4 hola
Try yourself: https://faker.deno.dev?body=hola&status=569
https://faker.deno.dev/
Specify a search body param to retrieve a response with that body.
GET https://faker.deno.dev/?body=hola HTTP/1.1 200 OK content-type: text/plain content-length: 4 hola
Specify a search status param to get back that code status. The status must be inside the range 200 to 599.
GET https://faker.deno.dev/?status=301 HTTP/1.1 301 Moved Permanently content-type: text/plain content-length: 0
Specify a search header param as a JSON string to get them back.
GET https://faker.deno.dev/?headers={"x-hello":"world"} HTTP/1.1 200 OK x-hello: world content-length: 0
Specify a search delay param in milliseconds in order to delay the response.
GET https://faker.deno.dev/?delay=1000
Replay with the same body and header as the request
POST https://faker.deno.dev/pong ?status=201 &delay=100 &body=willBeIgnored &headers={"x-hola":"mundo"} X-hello: world content-type: text/plain {"a":1} HTTP/1.1 201 Created X-hello: world x-hola: mundo content-type: text/plain {"a":1}
Official docs: https://fakerjs.dev
Default language is es, but can be specified with the accept-language
header.
To know the languages included, check out the docs at https://fakerjs.dev/guide/localization.html#available-locales
GET https://faker.deno.dev/name/firstName accept-language: en HTTP/1.1 200 OK content-type: application/json; charset=utf-8 "Chesley"
Once a path finds a method on Faker, the rest of the path will be used as arguments.
Using path phone/number/###-###-####
will call faker.phone.number('###-###-####')
GET https://faker.deno.dev/phone/number/###-###-#### HTTP/1.1 200 OK content-type: application/json; charset=utf-8 "956 687 564"
It can receive any type of argument, like object, array, string, number.
But keep in mind that objects and arrays must be passed as JSON strings.
GET https://faker.deno.dev/datatype/number/{"max":3,"min":1}
If needed, use encodeURIComponent
to pass an argument with special characters.
The following endpoints are available to get random data using faker.js. The API will return a JSON response with the data generated.