Free REST API for
Testing & Prototyping

Real REST API which is ready to handle your HTTP requests 24/7 for free. Can be used for your demo projects, testing, learning or even educating someone else
Public & Private Endpoints
Full CRUD Support
CORS Enabled
/objects/{id}
GET https://api.restful-api.dev/objects/7
// 200 OK
{
"id": "7",
"name": "Apple MacBook Pro 16",
"data": {
"year": 2019,
"price": 1849.99,
"CPU model": "Intel Core i9",
"Hard disk size": "1 TB"
}
}

Intro

Welcome to our real REST API - a fully functional service backed by a real database. It lets you send, store, and retrieve data through real HTTP requests, providing an experience much like working with a production backend. Its flexible design allows you to create and manage custom data structures, making it easy to simulate realistic REST API behavior for any project.
Whether you’re building demos, testing features, or waiting for backend updates, this API helps you generate and test responses as if everything were already live. It offers both public and authenticated access - the public version is open for quick exploration, while the more powerful authenticated version unlocks extra features, endpoints, and flexibility to shape your own data models and collections - perfect if you want to take things a bit further.

Main HTTP Methods Support

Support all major HTTP methods: GET, POST, PUT, PATCH and DELETE.

HTTPS Support

Secure connections via SSL/TLS for all API endpoints.

Cross-Origin Requests

CORS enabled for all domains, perfect for frontend development.

Flexible Resources Schema

Design any data structures and relationships using nested JSON objects for complete flexibility.

Overridable Status Codes

Authenticated endpoints include an optional feature that lets you override the returned HTTP status code to simulate different responses.

Always Available

99.9% uptime ensures reliable access for testing anytime, anywhere.

API Dog

Available Endpoints

Show endpoints for:
  • Description

    Retrieves a list of all available collections with basic metadata. Each collection represents a logical grouping of objects (for example, phones, computers, etc.).

    Collections are created automatically when an object is added via  POST  /collections/{collectionName}/objects. If the specified collectionName does not exist, it is created and the object is added to it.


    Headers

    x-api-key

    <your_api_key>required

    Parameters

    status string | number queryoptional

    Optional query parameter that allows you to override the default HTTP response status code returned by the API. This is handy for testing error handling or simulating different response scenarios. You can set it either as a numeric code (for example, ?status=401) or by using a standard HTTP status name (?status=NOT_FOUND). When provided, the API returns the specified status code along with a matching response body format.

    auth-type string queryoptional

    Optional query parameter that controls authentication for a request. Default is ?auth-type=none, meaning no authentication is required.

    Set it to jwt to access endpoints that require a JSON Web Token (JWT). In that case, include the token in the Authorization: Bearer <jwt> header. You can obtain this token from the /register or /login endpoints.


    Request url example

    https://api.restful-api.dev/collections


    Response body example
    1[
    2  {
    3    "collectionName": "phones",
    4    "objectCount": 12
    5  },
    6  {
    7    "collectionName": "tablets",
    8    "objectCount": 5
    9  },
    10  {
    11    "collectionName": "laptops",
    12    "objectCount": 7
    13  }
    14]
  • Description

    Retrieves a complete list of all objects stored within a specific authenticated collection created by you. You can also use query parameters to retrieve multiple specific objects by their IDs - useful when you only need a subset of objects instead of the entire collection


    Headers

    x-api-key

    <your_api_key>required

    Parameters

    collectionName string pathrequired

    Name of the collection to fetch objects from. This parameter is part of the request path, replacing {collectionName} in the endpoint URL.

    id string[] queryoptional

    Optional query parameter for specifying one or more object IDs. When provided, the response includes only the specified objects and excludes all others. Supports multiple values by repeating the parameter in the query string (e.g., ?id=3&id=5&id=10)

    status string | number queryoptional

    Optional query parameter that allows you to override the default HTTP response status code returned by the API. This is handy for testing error handling or simulating different response scenarios. You can set it either as a numeric code (for example, ?status=401) or by using a standard HTTP status name (?status=NOT_FOUND). When provided, the API returns the specified status code along with a matching response body format.

    auth-type string queryoptional

    Optional query parameter that controls authentication for a request. Default is ?auth-type=none, meaning no authentication is required.

    Set it to jwt to access endpoints that require a JSON Web Token (JWT). In that case, include the token in the Authorization: Bearer <jwt> header. You can obtain this token from the /register or /login endpoints.


    Request url example

    https://api.restful-api.dev/collections/products/objects


    Response body example
    1[
    2  {
    3    "id": "1",
    4    "name": "Google Pixel 6 Pro",
    5    "data": {
    6      "color": "Cloudy White",
    7      "capacity": "128 GB"
    8    }
    9  },
    10  {
    11    "id": "2",
    12    "name": "Apple iPhone 12 Mini, 256GB, Blue",
    13    "data": null
    14  },
    15  {
    16    "id": "3",
    17    "name": "Apple iPhone 12 Pro Max",
    18    "data": {
    19      "color": "Cloudy White",
    20      "capacity GB": 512
    21    }
    22  },
    23  {
    24    "id": "4",
    25    "name": "Apple iPhone 11, 64GB",
    26    "data": {
    27      "price": 389.99,
    28      "color": "Purple"
    29    }
    30  },
    31  {
    32    "id": "5",
    33    "name": "Samsung Galaxy Z Fold2",
    34    "data": {
    35      "price": 689.99,
    36      "color": "Brown"
    37    }
    38  },
    39  {
    40    "id": "6",
    41    "name": "Apple AirPods",
    42    "data": {
    43      "generation": "3rd",
    44      "price": 120
    45    }
    46  },
    47  {
    48    "id": "7",
    49    "name": "Apple MacBook Pro 16",
    50    "data": {
    51      "year": 2019,
    52      "price": 1849.99,
    53      "CPU model": "Intel Core i9",
    54      "Hard disk size": "1 TB"
    55    }
    56  },
    57  {
    58    "id": "8",
    59    "name": "Apple Watch Series 8",
    60    "data": {
    61      "Strap Colour": "Elderberry",
    62      "Case Size": "41mm"
    63    }
    64  },
    65  {
    66    "id": "9",
    67    "name": "Beats Studio3 Wireless",
    68    "data": {
    69      "Color": "Red",
    70      "Description": "High-performance wireless noise cancelling headphones"
    71    }
    72  },
    73  {
    74    "id": "10",
    75    "name": "Apple iPad Mini 5th Gen",
    76    "data": {
    77      "Capacity": "64 GB",
    78      "Screen size": 7.9
    79    }
    80  },
    81  {
    82    "id": "11",
    83    "name": "Apple iPad Mini 5th Gen",
    84    "data": {
    85      "Capacity": "254 GB",
    86      "Screen size": 7.9
    87    }
    88  },
    89  {
    90    "id": "12",
    91    "name": "Apple iPad Air",
    92    "data": {
    93      "Generation": "4th",
    94      "Price": "419.99",
    95      "Capacity": "64 GB"
    96    }
    97  },
    98  {
    99    "id": "13",
    100    "name": "Apple iPad Air",
    101    "data": {
    102      "Generation": "4th",
    103      "Price": "519.99",
    104      "Capacity": "256 GB"
    105    }
    106  }
    107]
  • Description

    Fetches detailed information about a single object inside the specified authenticated collection.


    Headers

    x-api-key

    <your_api_key>required

    Parameters

    collectionName string pathrequired

    Name of the collection to fetch object from. This parameter is part of the request path, replacing {collectionName} in the endpoint URL.

    id string pathrequired

    The unique ID of the object to fetch from the collection.

    status string | number queryoptional

    Optional query parameter that allows you to override the default HTTP response status code returned by the API. This is handy for testing error handling or simulating different response scenarios. You can set it either as a numeric code (for example, ?status=401) or by using a standard HTTP status name (?status=NOT_FOUND). When provided, the API returns the specified status code along with a matching response body format.

    auth-type string queryoptional

    Optional query parameter that controls authentication for a request. Default is ?auth-type=none, meaning no authentication is required.

    Set it to jwt to access endpoints that require a JSON Web Token (JWT). In that case, include the token in the Authorization: Bearer <jwt> header. You can obtain this token from the /register or /login endpoints.


    Request url example

    https://api.restful-api.dev/collections/products/objects/7


    Response body example
    1{
    2  "id": "7",
    3  "name": "Apple MacBook Pro 16",
    4  "data": {
    5    "year": 2019,
    6    "price": 1849.99,
    7    "CPU model": "Intel Core i9",
    8    "Hard disk size": "1 TB"
    9  }
    10}
  • Description

    Creates a new object and adds it to the specified collection owned by the authenticated user.


    Headers

    x-api-key

    <your_api_key>required

    Content-Type

    application/jsonrequired

    Parameters

    collectionName string pathrequired

    The collection where the new object should be created. This value is provided as a path parameter, replacing {collectionName} in the endpoint URL.

    status string | number queryoptional

    Optional query parameter that allows you to override the default HTTP response status code returned by the API. This is handy for testing error handling or simulating different response scenarios. You can set it either as a numeric code (for example, ?status=401) or by using a standard HTTP status name (?status=NOT_FOUND). When provided, the API returns the specified status code along with a matching response body format.

    auth-type string queryoptional

    Optional query parameter that controls authentication for a request. Default is ?auth-type=none, meaning no authentication is required.

    Set it to jwt to access endpoints that require a JSON Web Token (JWT). In that case, include the token in the Authorization: Bearer <jwt> header. You can obtain this token from the /register or /login endpoints.


    Request url example

    https://api.restful-api.dev/collections/products/objects


    Request body example
    1{
    2  "name": "Apple MacBook Pro 16",
    3  "data": {
    4    "year": 2019,
    5    "price": 1849.99,
    6    "CPU model": "Intel Core i9",
    7    "Hard disk size": "1 TB"
    8  }
    9}

    Response body example
    1{
    2  "id": "7",
    3  "name": "Apple MacBook Pro 16",
    4  "data": {
    5    "year": 2019,
    6    "price": 1849.99,
    7    "CPU model": "Intel Core i9",
    8    "Hard disk size": "1 TB"
    9  },
    10  "createdAt": "2022-11-21T20:06:23.986Z"
    11}
  • Description

    Replaces an existing object completely with new data inside a specific authenticated collection.


    Headers

    x-api-key

    <your_api_key>required

    Content-Type

    application/jsonrequired

    Parameters

    collectionName string pathrequired

    The collection that contains the object you want to fully replace. This value is provided as a path parameter, replacing {collectionName} in the endpoint URL.

    id string pathrequired

    The ID of the object to update entirely with new data. This value is provided as a path parameter, replacing {id} in the endpoint URL.

    status string | number queryoptional

    Optional query parameter that allows you to override the default HTTP response status code returned by the API. This is handy for testing error handling or simulating different response scenarios. You can set it either as a numeric code (for example, ?status=401) or by using a standard HTTP status name (?status=NOT_FOUND). When provided, the API returns the specified status code along with a matching response body format.

    auth-type string queryoptional

    Optional query parameter that controls authentication for a request. Default is ?auth-type=none, meaning no authentication is required.

    Set it to jwt to access endpoints that require a JSON Web Token (JWT). In that case, include the token in the Authorization: Bearer <jwt> header. You can obtain this token from the /register or /login endpoints.


    Request url example

    https://api.restful-api.dev/collections/products/objects/7


    Request body example
    1{
    2  "name": "Apple MacBook Pro 16",
    3  "data": {
    4    "year": 2019,
    5    "price": 2049.99,
    6    "CPU model": "Intel Core i9",
    7    "Hard disk size": "1 TB",
    8    "color": "silver"
    9  }
    10}

    Response body example
    1{
    2  "id": "7",
    3  "name": "Apple MacBook Pro 16",
    4  "data": {
    5    "year": 2019,
    6    "price": 2049.99,
    7    "CPU model": "Intel Core i9",
    8    "Hard disk size": "1 TB",
    9    "color": "silver"
    10  },
    11  "updatedAt": "2022-12-25T21:08:41.986Z"
    12}
  • Description

    Applies partial updates to an object in an authenticated collection without overwriting all of its fields.


    Headers

    x-api-key

    <your_api_key>required

    Content-Type

    application/jsonrequired

    Parameters

    collectionName string pathrequired

    The collection that holds the object you want to modify partially. This value is provided as a path parameter, replacing {collectionName} in the endpoint URL.

    id string pathrequired

    The ID of the object to modify. This value is provided as a path parameter, replacing {id} in the endpoint URL.

    status string | number queryoptional

    Optional query parameter that allows you to override the default HTTP response status code returned by the API. This is handy for testing error handling or simulating different response scenarios. You can set it either as a numeric code (for example, ?status=401) or by using a standard HTTP status name (?status=NOT_FOUND). When provided, the API returns the specified status code along with a matching response body format.

    auth-type string queryoptional

    Optional query parameter that controls authentication for a request. Default is ?auth-type=none, meaning no authentication is required.

    Set it to jwt to access endpoints that require a JSON Web Token (JWT). In that case, include the token in the Authorization: Bearer <jwt> header. You can obtain this token from the /register or /login endpoints.


    Request url example

    https://api.restful-api.dev/collections/products/objects/7


    Request body example
    1{
    2  "name": "Apple MacBook Pro 16 (Updated Name)"
    3}

    Response body example
    1{
    2  "id": "7",
    3  "name": "Apple MacBook Pro 16 (Updated Name)",
    4  "data": {
    5    "year": 2019,
    6    "price": 1849.99,
    7    "CPU model": "Intel Core i9",
    8    "Hard disk size": "1 TB"
    9  },
    10  "updatedAt": "2022-12-25T21:09:46.986Z"
    11}
  • Description

    Removes an object permanently from the authenticated user’s collection using its unique ID.


    Headers

    x-api-key

    <your_api_key>required

    Parameters

    collectionName string pathrequired

    The collection that contains the object you want to delete. This value is provided as a path parameter, replacing {collectionName} in the endpoint URL.

    id string pathrequired

    The unique ID of the object to remove from the collection. This value is provided as a path parameter, replacing {id} in the endpoint URL.

    status string | number queryoptional

    Optional query parameter that allows you to override the default HTTP response status code returned by the API. This is handy for testing error handling or simulating different response scenarios. You can set it either as a numeric code (for example, ?status=401) or by using a standard HTTP status name (?status=NOT_FOUND). When provided, the API returns the specified status code along with a matching response body format.

    auth-type string queryoptional

    Optional query parameter that controls authentication for a request. Default is ?auth-type=none, meaning no authentication is required.

    Set it to jwt to access endpoints that require a JSON Web Token (JWT). In that case, include the token in the Authorization: Bearer <jwt> header. You can obtain this token from the /register or /login endpoints.


    Request url example

    https://api.restful-api.dev/collections/products/objects/6


    Response body example
    1{
    2  "message": "Object with id = 6, has been deleted."
    3}
  • Description

    Creates a new user account in the system. Upon successful registration, this endpoint generates and returns a valid JSON Web Token (JWT) that can be used to authorize future requests to other endpoints. Many endpoints in this API optionally support authentication and can be accessed as protected endpoints by including the query parameter ?auth-type=jwt along with the JWT issued by this /register endpoint.


    Headers

    x-api-key

    <your_api_key>required

    Content-Type

    application/jsonrequired

    Parameters

    expires-in number queryoptional

    Optional query parameter that specifies the lifetime of the generated authentication token in seconds. If omitted, the token is created with the default expiration period of 3600 seconds (one hour).

    status string | number queryoptional

    Optional query parameter that allows you to override the default HTTP response status code returned by the API. This is handy for testing error handling or simulating different response scenarios. You can set it either as a numeric code (for example, ?status=401) or by using a standard HTTP status name (?status=NOT_FOUND). When provided, the API returns the specified status code along with a matching response body format.


    Request url example

    https://api.restful-api.dev/register


    Request body example
    1{
    2  "email": "[email protected]",
    3  "password": "securePassword123",
    4  "name": "Antonio"
    5}

    Response body example
    1{
    2  "token": "<jwt token returned by the server upon successful registration>",
    3  "tokenType": "Bearer",
    4  "expiresIn": 3600,
    5  "user": {
    6    "id": "123a",
    7    "email": "[email protected]",
    8    "name": "Antonio"
    9  }
    10}
  • Description

    Authenticates an existing user using valid credentials. Upon successful login, this endpoint generates and returns a valid JSON Web Token (JWT) that can be used to authorize future requests to other endpoints. Many endpoints in this API optionally support authentication and can be accessed as protected endpoints by including the query parameter ?auth-type=jwt along with the JWT issued by this /login endpoint.


    Headers

    x-api-key

    <your_api_key>required

    Content-Type

    application/jsonrequired

    Parameters

    expires-in number queryoptional

    Optional query parameter that specifies the lifetime of the generated authentication token in seconds. If omitted, the token is created with the default expiration period of 3600 seconds (one hour).

    status string | number queryoptional

    Optional query parameter that allows you to override the default HTTP response status code returned by the API. This is handy for testing error handling or simulating different response scenarios. You can set it either as a numeric code (for example, ?status=401) or by using a standard HTTP status name (?status=NOT_FOUND). When provided, the API returns the specified status code along with a matching response body format.


    Request url example

    https://api.restful-api.dev/login


    Request body example
    1{
    2  "email": "[email protected]",
    3  "password": "securePassword123"
    4}

    Response body example
    1{
    2  "token": "<jwt token returned by the server upon successful login>",
    3  "tokenType": "Bearer",
    4  "expiresIn": 3600,
    5  "user": {
    6    "id": "123a",
    7    "email": "[email protected]",
    8    "name": "Antonio"
    9  }
    10}

How to Use It

Get started with our REST API in your favorite programming language. Choose from the examples below.

1// Using Fetch API
2fetch('https://api.restful-api.dev/objects')
3  .then(response => response.json())
4  .then(data => console.log('GET Response:', data))
5  .catch(error => console.error('Error:', error));
6
7// POST request
8fetch('https://api.restful-api.dev/objects', {
9  method: 'POST',
10  headers: {
11    'Content-Type': 'application/json',
12  },
13  body: JSON.stringify({
14    name: 'Apple MacBook Pro 16',
15    data: {
16      year: 2019,
17      price: 1849.99,
18      'CPU model': 'Intel Core i9',
19      'Hard disk size': '1 TB'
20    }
21  })
22})
23  .then(response => response.json())
24  .then(data => console.log('POST Response:', data));

Frequently Asked Questions

Find answers to common questions about our REST API service.

Public endpoints are open and accessible to anyone for quick testing and experimentation with the API. In some cases, they return predefined data, but in others they also allow you to create and retrieve data created by you, making them great for demos and learning. Authenticated endpoints require authentication and provide greater flexibility and control over your own data. You can create custom collections and manage objects in a secure and controlled environment that is accessible only to you or your users. To use authenticated endpoints, you need to sign in or create an account on our website to obtain your own API key. This API key must be included in the request headers (using the x-api-key header) when making requests to the authenticated API.

Yes, you can use POST, PUT, PATCH, and DELETE methods to create, update, and delete objects. This functionality is supported on both public and authenticated APIs that we provide.

Yes, the API has CORS (Cross-Origin Resource Sharing) enabled, which means you can make requests from any domain, including from your browser-based applications and localhost.

Yes, you can freely use our API for development, testing, and learning. Each user receives 50 daily requests for the Public API and 100 daily requests for the Authenticated API (reset every 24 hours). For higher limits or advanced features, we also offer Pro plans.

All standard REST API methods are supported: GET (retrieve data), POST (create new resources), PUT (update entire resources), PATCH (partial updates), and DELETE (remove resources).

Yes. Authenticated endpoints include an optional query parameter called `status` that lets you override the default HTTP status code returned by the API. This is useful when you want to test how your app handles different responses - for example, ?status=401 or ?status=NOT_FOUND. When used, the API returns the chosen status code along with a matching response body format, making it easy to simulate error handling or custom scenarios.

Yes! We’re always open to suggestions for new features, endpoints, or improvements. Feel free to share your ideas with us at [email protected]

Still have questions?

Can't find the answer you're looking for? Feel free to reach out.

Contact Us →