Menu

GeoDB Cities API

Pagination

Collection Response Format

Any collection request will have the following basic response format:

{
  metadata: {
    currentOffset: ZERO_BASED_INDEX_OF_THE_FIRST_RESULT,
    totalCount: TOTAL_NUMBER_OF_RESULTS
  }
  results: [
    {
      result1
    },
    {
      result2
    },
    ...
  ]
}

Pagination Links

If you are making a collection request and the number of results exceeds the requested limit (page size), you will see the following additional elements in the response:

{
  ...
  "links":[
    {
      "rel":"first",
      "href":"/link/to/first/page/of/results"
    },
    {
      "rel":"prev",
      "href":"/link/to/previous/page/of/results"
    },
    {
      "rel":"next",
      "href":"/link/to/next/page/of/results"
    },
    {
      "rel":"last",
      "href":"/link/to/last/page/of/results"
    }
  ]
}

These links adhere to the HATEOAS format and should be self-explanatory.