Skip to main content

Pagination

All list endpoints in the Epidemic Sound API use offset-based pagination. Results are divided into pages controlled by two query parameters: limit and offset.

Query parameters

ParameterDescription
limitNumber of items to return per page (default and max vary per endpoint — see table below)
offsetNumber of items to skip before starting the result set (default: 0)

Per-endpoint limits

EndpointDefault limitMax limit
GET /v0/tracks/search5060
GET /v0/tracks50100
GET /v0/collections1020
GET /v0/collections/{collectionId}50100
GET /v0/moods, GET /v0/genres2020
GET /v0/sound-effects/categories50
GET /v0/sound-effects/categories/{id}/tracks50100
GET /v0/tracks/matching-image/{imageId}50100
GET /v0/users/me/liked/tracks25 (fixed)25
Fixed page size for liked tracks

GET /v0/users/me/liked/tracks does not accept a limit parameter — it always returns 25 results per page. The offset must be evenly divisible by 25.

Pagination response

Every list response includes a pagination object and a links object:

{
"tracks": [...],
"pagination": {
"page": 2,
"limit": 25,
"offset": 25
},
"links": {
"next": "/v0/tracks/search?limit=25&offset=50",
"prev": "/v0/tracks/search?limit=25&offset=0"
}
}
FieldDescription
pagination.pageCurrent page number (1-based)
pagination.limitNumber of items returned in this response
pagination.offsetNumber of items skipped
links.nextRelative path for the next page, or null
links.prevRelative path for the previous page, or null

When links.next is null, you have reached the last page.

Fetching the first page

curl "https://partner-content-api.epidemicsound.com/v0/tracks/search?term=happy&limit=25&offset=0" \
-H "Authorization: Bearer USER_TOKEN"

Fetching all pages

Use links.next to determine whether more pages exist. Append the offset from the next link to the same base request, or construct it yourself by incrementing offset by limit each iteration.

async function fetchAllTracks(userToken, searchTerm) {
const baseUrl = 'https://partner-content-api.epidemicsound.com'
const limit = 50
let offset = 0
let allTracks = []

while (true) {
const response = await fetch(
`${baseUrl}/v0/tracks/search?term=${encodeURIComponent(
searchTerm
)}&limit=${limit}&offset=${offset}`,
{ headers: { Authorization: `Bearer ${userToken}` } }
)
const data = await response.json()

allTracks = allTracks.concat(data.tracks)

if (!data.links.next) {
break
}
offset += limit
}

return allTracks
}

Best practices

  • Request only what you need. Fetch a single page at a time rather than loading all results upfront. For a search results UI, 20–30 results per page is usually sufficient.
  • Use links.next as your stop condition. When links.next is null (or absent), you have reached the last page.
  • Avoid high offsets on large catalogs. Performance degrades with very large offsets. Use filters (mood, genre, term) to narrow results before paginating.
  • Cache the current page offset. If users navigate between pages in your UI, store the current offset so you can resume without re-fetching earlier pages.