The API returns items in pages or results, rather than all of the results at once.

The default number of results per response (or “page”) is 25. You can change how many are in each response by using the c parameter in your request, for example c=100. Be considerate and keep your count to a reasonable number. Your response may take longer to return if you set it too high.

The pagination section of the response has the information you’ll need to understand which page of results you’re on. One way to get the next page of results is to use the URL in the next field. When there are no more pages, it will be null.

Field (within "pagination") Description Example
from Index number of the first result item in this page of results. 26
to Index number of the last result in this page of results. 50
results Index numbers of the result items in this page. “26 - 50”
last URL of the last page of results in the whole set of results pages. "https://www.loc.gov/search/?q=giraffe&sp=5&fo=json”
of Total number of items in the results. 318
previous URL of the preceding page of results. Will be null when this is the first page. "https://www.loc.gov/search/?q=giraffe&sp=1&fo=json",
next URL of the next page of results. Will be null when there are not more pages. "https://www.loc.gov/search/?q=giraffe&sp=3&fo=json"
perpage Number of result items on each page. 25
total Total number of pages available. 5
current Page number you are currently on. 2

Example:

https://www.loc.gov/collections/national-child-labor-committee/?sp=2&c=100&fo=json

Pagination section of JSON in a search result response:

{
  "pagination": {
    "from": 1,
    "results": "1 - 25",
    "last": "https://www.loc.gov/collections/civil-war-maps/?sp=4&fo=json",
    "total": 94,
    "previous": null,
    "perpage": 25,
    "perpage_options": [
      25,
      50,
      100,
      150
    ],
    "of": 2335,
    "next": "https://www.loc.gov/collections/civil-war-maps/?sp=2&fo=json",
    "current": 1,
    "to": 25,
    "page_list": [
      {
        "url": null,
        "number": 1
      },
      {
        "url": "https://www.loc.gov/collections/civil-war-maps/?sp=2&fo=json",
        "number": 2
      },
      {
        "url": "https://www.loc.gov/collections/civil-war-maps/?sp=3&fo=json",
        "number": 3
      },
      {
        "url": "https://www.loc.gov/collections/civil-war-maps/?sp=4&fo=json",
        "number": "..."
      }
    ],
    "first": null
  }
}