/api

💁‍♀️ A simple API service powered by My JSON Server

API

💁‍♀️ A simple API service powered by My JSON Server

Available resources

Fruits

GET /fruits - get all fruits

GET /fruits/:id - get a fruit by id

Posts

GET /posts - get all posts

Books and authors

GET /authors - get all authors

GET /books - get all books

GET /authors/:id/books - get all books from an author by id

Pokemon

GET /pokemon - get all Pokémon

GET /pokemon/id - get a Pokémon by id

Create a new resource

To create a new resource simply add a new property to db.json. See example here.

{
  "posts": [
    { "id": 1, "title": "Post 1" },
    { "id": 2, "title": "Post 2" },
    { "id": 3, "title": "Post 3" }
  ],
  "comments": [
    { "id": 1, "body": "some comment", "postId": 1 },
    { "id": 2, "body": "some comment", "postId": 1 }
  ]
}

This creates two resources posts and comments and these endpoints

  • GET /posts - gets all posts
  • GET /posts/1 - gets one post with id
  • GET /comments - gets all comments
  • GET /comments/1 - gets one comment with id
  • GET /posts/1/comments - gets all comments belonging to a post

List of public APIs

You may want to check these out for public APIs

Caveat emptor

☝️ This API service is used for training and teaching purposes only. It is not meant to be used for production apps.