Skip to content

Quickstart

Support Dummy API's Mission

Your contribution will help me to keep Dummy API Ad-Free and also help with the development of new and faster endpoints. You can choose to support me via Stripe, PayPal, or become a member of my Patreon.

DummyAPI Logo

Help Dummy API to stay Ad-Free 💕

A donation as little as 1$ helps!
Payments powered by Stripe Logo

This quickstart guide will provide a simple introduction to using DummyAPI. Below, you’ll find a selection of example endpoints to help you start integrating data into your applications.

Fetch all movies

fetch('https://dummyapi.online/api/movies')
.then((response) => response.json())
.then((json) => console.log(json));
Output
[
{
id: 1,
movie: 'The Shawshank Redemption',
rating: 9.2,
image: 'images/shawshank.jpg',
imdb_url: 'https://www.imdb.com/title/tt0111161/'
},
{
id: 2,
movie: 'The Godfather',
rating: 9.2,
image: 'images/godfather.jpg',
imdb_url: 'https://www.imdb.com/title/tt0068646/'
},
...
]

Fetch a single movie

Getting a single entry of a certain resource. In this example, we use the /api/movies/1 route.

fetch('https://dummyapi.online/api/movies/1')
.then((response) => response.json())
.then((json) => console.log(json));
Output
{
id: 1, movie: 'The Shawshank Redemption',
rating: 9.2, image: 'images/shawshank.jpg',
imdb_url: 'https://www.imdb.com/title/tt0111161/'
}

Create a User

This allows you to create a new entry in our users route. Be aware that you can’t create a new user with an id that already exists.

Note: At this moment we only support creating new resources in the /api/users route.

fetch('https://dummyapi.online/api/users', {
method: 'POST',
body: JSON.stringify({
id: 11,
name: "Elon Musk",
username: "elonmusk",
email: "elonmusk@planet.mars"
}),
headers: {
'Content-type': 'application/json'
},
})
.then((response) => response.json())
.then((json) => console.log(json));
Output
{
"message": "User created successfully:",
id: 11,
name: "Elon Musk",
username: "elonmusk",
email: "elonmusk@planet.mars"
}

Important: Please note that resources will not be actually updated on our server, but you will receive a legitimate response as if they were!