Skip to content
Live · v2 stable

REST API for testing and prototyping

Realistic data for users, posts, comments and todos. Bearer token auth, your own rate limit, JSON or XML. Spend your time on the app you are building, not on fake data.

  • HTTPS only
  • Fresh data every 3 hours
  • Rate limited
  • JSON or XML
curl -H "Authorization: Bearer YOUR_TOKEN" \
     https://gorest.co.in/public/v2/users
GET/public/v2/usersOpen in console
Users
-
not loaded
Posts
-
not loaded
Comments
-
not loaded
Todos
-
not loaded
CheckingData resets every 3 hours
Status page
Why GoRest

Skip the backend. Ship the frontend.

Realistic users, posts, comments and todos, linked like a real app. Build, test and demo without waiting for an API team.

Free, no quota

Log in with Google, Microsoft or GitHub, make a token, and start.

Realistic data

Names, emails, posts and comments, seeded again every 3 hours. Relations work like a real app.

JSON or XML

Add the format to the path or set the Accept header.

You set the limit

Each token has its own rate limit. Pagination headers do the rest.

Quick start

From zero to the first request in a minute

  1. 1

    Log in

    With Google, Microsoft or GitHub. We never see a password.

    Log in
  2. 2

    Make a token

    Set its rate limit, and revoke it any time. It is shown only once.

    Your tokens
  3. 3

    Send requests

    Put the token in the Authorization header. Try things in the console first if you like.

    Open the console
Resources

Four resources, linked like a real app

Users own posts and todos. Posts collect comments.

- rows

Users

People with a name, email, gender and status.

https://gorest.co.in/public/v2/users
- rows

Posts

Articles written by users, with a title and a body.

https://gorest.co.in/public/v2/posts
- rows

Comments

Comments that belong to posts.

https://gorest.co.in/public/v2/comments
- rows

Todos

Tasks owned by users, with a due date and a status.

https://gorest.co.in/public/v2/todos
Endpoints

Endpoints at a glance

Every path is under https://gorest.co.in. Reads need no token. Writes need one.

v2/public/v2/v1gone, answers 410

Users

GET/public/v2/usersList users, with optional filters
GET/public/v2/users/{id}Fetch one user
POST/public/v2/usersCreate a user
PATCH/public/v2/users/{id}Update some fields of a user
PUT/public/v2/users/{id}Replace a user
DELETE/public/v2/users/{id}Delete a user

Nested

GET/public/v2/users/{id}/postsPosts of a user
POST/public/v2/users/{id}/postsCreate a post for a user
GET/public/v2/posts/{id}/commentsComments on a post
POST/public/v2/posts/{id}/commentsAdd a comment to a post
GET/public/v2/users/{id}/todosTodos of a user
POST/public/v2/users/{id}/todosCreate a todo for a user
The same paths work for /public/v2/posts, /public/v2/comments and /public/v2/todos. Any field is a filter, for example /public/v2/users?name=kumar. Page with page and per_page (at most 100).
Sample response

What you get back

The body is the resource itself. Pagination is in the headers. For XML, add .xml to the path or send Accept: application/xml.

v2GET /public/v2/users
[
  {
    "id": 4521,
    "name": "Avani Iyer",
    "email": "avani.iyer@example.com",
    "gender": "female",
    "status": "active"
  },
  {
    "id": 4520,
    "name": "Pranav Kapoor",
    "email": "pranav.kapoor@example.com",
    "gender": "male",
    "status": "inactive"
  }
]
Pagination headers

Page through anything

  • X-Pagination-Total
    Total matching results
  • X-Pagination-Pages
    Total pages
  • X-Pagination-Page
    Current page
  • X-Pagination-Limit
    Results per page
  • X-Links-Previous
    Full URL of the previous page; empty on page 1
  • X-Links-Current
    Full URL of this page
  • X-Links-Next
    Full URL of the next page; empty on the last page
Authentication

Bearer tokens, the simple kind

Send your token with every write, over HTTPS, in one of two ways:

  • Header: Authorization: Bearer YOUR_TOKEN
  • Query parameter: https://gorest.co.in/public/v2/users?access-token=YOUR_TOKEN

The header is the better choice: URLs end up in logs. Make a token on your tokens page. It is shown only once.

Do not put real personal data here. This is a public sandbox.
Rate limit headers

Know your budget

  • X-RateLimit-Limit
    Requests per minute allowed for this token
  • X-RateLimit-Remaining
    Requests left in the current window
  • X-RateLimit-Reset
    Seconds until the window resets
Set the limit on your token
Response codes

Standard HTTP response codes

What each status code means, and the common reason you will see it.

200
OK

GET worked; the resource is in the body.

201
Created

POST made a new resource; the Location header points to it.

204
No Content

DELETE worked; there is no body.

304
Not Modified

Your cached copy is still fresh.

400
Bad Request

The body or query string is malformed.

401
Unauthorized

The token is missing, wrong or expired.

403
Forbidden

The token cannot access this resource.

404
Not Found

Nothing at this URL, or it belongs to another token.

405
Method Not Allowed

The URL does not accept this HTTP method.

415
Unsupported Media Type

Content-Type is not JSON or XML.

422
Unprocessable

The JSON parsed but failed validation; the body lists the bad fields.

429
Too Many Requests

The rate limit is used up; retry after X-RateLimit-Reset seconds.

500
Server Error

Something broke on our side. Quote X-Request-Id when you report it.

503
Service Unavailable

Down for maintenance or busy for a moment. Retry soon.

FAQ

Quick answers

The questions we hear most. If yours is not here, ask in Q&A.

Browse Q&A
Q

Is it really free?

A

Yes. No card and no paid tier. The data is reset often, so do not store anything you need.

Q

What gets reset?

A

All records are wiped and seeded again every 3 hours, so the API always has fresh data.

Q

Can other people see my data?

A

No. Records you create or change are visible only to your token. The seeded data is shared.

Q

JSON or XML?

A

Either. Add .json or .xml to any path, or set the Accept header.

Q

What is the rate limit?

A

300 requests a minute per token by default. You can set it per token from 1 to 600.

Q

Can I test loading states and error handlers?

A

Yes. Add ?delay=1500 to a GET to wait up to 5 seconds, or ?force_status=500 to get that error. Allowed codes are 400, 401, 403, 404, 405, 415, 422, 429, 500 and 503. The answer carries an X-Simulated-Delay-Ms or X-Simulated-Status header. See the recipes for examples.

Q

Can I call it from the browser?

A

Yes. CORS is open. Keep your token out of code you ship to users.

Q

How do I report a bug?

A

Ask in Q&A, or write to the address on the about page.