# Basic API usage
This guide provides a brief introduction to our API, including how to make simple requests and understand example responses.
Welcome to the User.com API! This tutorial will help you understand the basics of using our API to retrieve data and build integrations with our application.
An API (Application Programming Interface) is an interface that allows different software components to communicate. Our API follows REST (Representational State Transfer) principles, which means you can perform actions using standard HTTP methods like POST, PUT, GET, and DELETE.
# Navigating the documentation
Our documentation is organized into sections that correspond to the main areas of the User.com web application. You can use the navigation menu on the left to select a section and find the endpoint you need.
Each endpoint page includes:
- A short description and usage example.
- An overview of request parameters.
- Code snippets in various languages, including cURL, JavaScript (jQuery & Node.js), PHP, and Python.
# API endpoint structure
All API requests should be made to the following base URL, ensuring it ends with a trailing slash:
https://<your_app_subdomain>.user.com/api/public/
The rest of the URL path depends on the specific resource you want to access. For example, to access users, the URL would be:
https://<your_app_subdomain>.user.com/api/public/users/
INFO
Each and every request must have Authorization: Token <your_64_char_api_key> included in header.
This request will display list of all our users.
# Example request
- CURL
- JavaScript
- PHP
- Python
curl --location --request GET 'https://<your_app_subdomain>.user.com/api/public/users/:id/' \
--header 'Authorization: Token <your_64_char_api_key>' \
--header 'Accept: */*; version=2'
# Response pagination
We use cursor-based pagination and return up to 100 results per page (the exact limit may vary by endpoint) to prevent overload of data and ensure optimal performance.
# Response fields
| Field | Type | Description |
|---|---|---|
count | integer | Total number of items across all pages |
next | string/null | URL for the next page (null on last page) |
previous | string/null | URL for the previous page (null on first page) |
results | array | Array of objects for the current page |
# Pagination examples
First page (no previous link):
{
"count": 664,
"next": "https://<your_app_subdomain>.user.com/api/public/users/?cursor=1971",
"previous": null,
"results": [
// 100 user objects...
]
}
Middle page (has both links):
{
"count": 664,
"next": "https://<your_app_subdomain>.user.com/api/public/users/?cursor=1525",
"previous": "https://<your_app_subdomain>.user.com/api/public/users/?cursor=1970&rev=1",
"results": [
// 100 user objects...
]
}
Last page (no next link, partial results):
{
"count": 664,
"next": null,
"previous": "https://<your_app_subdomain>.user.com/api/public/users/?cursor=1122&rev=1",
"results": [
// 64 user objects...
]
}
Navigation: Use the complete URLs from next/previous fields. Forward navigation uses ?cursor=VALUE, backward navigation uses ?cursor=VALUE&rev=1.
# Important note about pagination
404 RESPONSE ON EMPTY PAGES
When the total number of records is exactly divisible by the page size, the next link may be present on the last page but will return a 404 error when accessed.
Example scenario:
- Total records: 300
- Page size: 100 records per page
- Pages 1-3: Each shows 100 records with
nextlink - Page 4: Does not exist and returns 404
This behavior is intentional for performance optimization. Always handle potential 404 responses when following next pagination links.
# Request limits
RATE LIMITS
API requests are limited to 10 requests per second per user. Exceeding this limit will result in HTTP 429 (Too Many Requests) responses.