Rate Limit
The API operates with a rate limit of 1200 requests per 10 min. This means that you can send maximum 2 requests per second within any 10 minute period. Note that this limit is shared across all our endpoints, rather than being counted towards individual endpoints.
If you exceed this limit, you will receive a 429 Too Many Requests
response.
Current rate limit status is available in the RateLimit
header.
Example: RateLimit: limit=1200, remaining=956, reset=543
. See IETF draft for more details.
Should you have a problem with hitting this limit, please introduce a latency period between requests in order to get below the limit again.
Filters / Path Arguments
There is a limit of 50 arguments (ie. user IDs) per call when filtering using the path arguments.
Pagination
Max results per page is 50. Use page
and per_page
query parameters to fetch additional results. Example: /users?page=3&per_page=30
.
How to fetch all the data from an API with pagination limits?
Note: This example uses GET /groups, but you can repeat the steps with other endpoints.
- Fetch all the data:
for i in {1..NUMBER_OF_PAGES}; do
curl -X GET "https://motimateapp.com/public_api/groups?page=$i"
done - Store the data on your machine.
- Fetch only resources that have been updated or created after the last fetch (e.g. one day ago) and merge it to the data you already have:
curl -X GET "https://motimateapp.com/public_api/groups?filter[created_at_gt]=<ONE_DAY_AGO>"
curl -X GET "https://motimateapp.com/public_api/groups?filter[updated_at_gt]=<ONE_DAY_AGO>"
- Whenever you perform a DELETE request, remove the resource from your copy.
- Periodically (e.g. weekly) perform a resync by fetching all the data again and updating your copy.