Dummy Static Data API Documentation

GET Endpoints to get static json data.

Base Data URL

https://dummyapi.io/data/api/

Headers

It is required to set app-id Header for all endpoints to track user statistic.
You can get personal App ID value on your account page.
Example: app-id: 0JyYiOQXQQr5H9OEn21312

Data Pagination

For some endpoints you will get a single item. But for some of them it should be a list of objects.
To control amount of items, you need to use page and limit URL params.
Limit value should be in range [5-50]. Default value: 20
Page value should be in range [0-999]. Default value: 0
Example: https://dummyapi.io/data/api/user?page=1&limit=10
Take 10 elements on a second page(page number starts from zero). Return items from 11 to 20 in a default order.

Data Explorer

Check data Explorer page to get more info about Data relations, and possible fields values.
Data Explorer Page
User
Dummy API Endpoints that returns User model data in response
GET
/user
Get users list
Response: array(User)
GET
/user/{userId}
Get user Full profile
Response: User
Post
API Endpoints to get Post data by various filters as user/tag etc.
GET
/post
Get posts list
Response: array(Post)
GET
/post/{postId}
Get single post
Response: Post
GET
/user/{userId}/post
Get posts list created by user
Response: array(Post)
GET
/tag/{tagTitle}/post
Get posts list by tag title
Response: array(Post)
Comment
Dummy API Endpoints to get Comment data by each post
GET
/post/{postId}/comment
Get post comments list
Response: array(Comment)
Tag
Dummy API Endpoints to get Tag list that used by posts
GET
/tag
Get tags list
Response: array(Tag)

Sample code of Dummyapi usage


API call on React(Javascript) using Axios

Axios is a simple HTTP client library, that allows us to make API call's on both server-side and client-side.
The main benefit is easy to interface and Promises support.
Link to library https://github.com/axios/axios

import React, { useEffect, useState } from 'react';
import axios from 'axios';

const BASE_URL = 'https://dummyapi.io/data/api';
const APP_ID = '{APP_ID}';

const App = () => {
    const [loading, setLoading] = useState(false);
    const [data, setData] = useState(null);

    useEffect(() => {
        setLoading(true);
        axios.get(`${BASE_URL}/user`, { headers: { 'app-id': APP_ID } })
            .then(({ data }) => setData(data))
            .catch(console.error)
            .finally(() => setLoading(false));
    }, []);

    return (
        <div>
           {loading && "Loading..."}
           {JSON.stringify(data)}
        </div>
    );
};

export { App };
Privacy PolicyCookie PolicyTerms and Conditions