JSONPlaceholder is a free online REST API that you can use whenever you need some fake data.
It's great for tutorials, testing new libraries, sharing code examples, ...
Run this code in a console or from any site:
fetch('https://jsonplaceholder.typicode.com/todos/1') .then(response => response.json()) .then(json => console.log(json))
Congrats you've made your first call to JSONPlaceholder! 😃 🎉
Tip: you can use http or https when making requests to JSONPlaceholder.
JSONPlaceholder comes with a set of 6 common resources:
Note: resources have relations. For example: posts have many comments, albums have many photos, ... see below for routes examples.
All HTTP methods are supported.
Note: you can view detailed examples here.
Use your own data
JSON Server powers this website. You can use it to create the same fake API in less than 30 seconds with your own data.
npm install json-server
You can also try My JSON Server free service.