Update-available.com - Documentation

API

Pagination

In this guide, we will look at how to work with paginated responses when querying the Update-available API. By default, all responses limit results to 25. However, you can go as high as 100 by adding a limit parameter to your requests.


Example pagination

In this example, we requested a list of our favorites.

Entries

  • Name
    from
    Type
    integer
    Description

    Denotes the starting index of the data displayed on the current page.

  • Name
    to
    Type
    integer
    Description

    Signifies the ending index of the data displayed on the current page.

  • Name
    total
    Type
    integer
    Description

    Reflects the overall count of items across all pages.

Pages

  • Name
    current_page
    Type
    integer
    Description

    Indicates the currently displayed page of results.

  • Name
    last_page
    Type
    integer
    Description

    Specifies the total number of available pages in the paginated results.

  • Name
    per_page
    Type
    integer
    Description

    Represents the maximum number of items shown per page.

Request

.../api/v1/favorite

Response

{
  "data": [...],
  "links": {
    "self": "http://update-available.com/api/v1/favorite"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 2,
    "per_page": 15,
    "to": 15,
    "total": 23
  }
}

To access the subsequent page of paginated results, you can utilize the current_page value provided in the response's metadata. By incrementing this value, you can retrieve the next set of data entries. For example, if the current_page is 1, to access the next page, simply increment it to 2 and make a new API request with the updated value. This approach enables you to seamlessly navigate through the paginated results and retrieve the successive data sets until you've obtained all the desired information.

Request

.../api/v1/favorite?page=2

Response

{
  "data": [...],
  "links": {
    "self": "http://update-available.com/api/v1/favorite"
  },
  "meta": {
    "current_page": 2,
    "from": 16,
    "last_page": 2,
    "per_page": 15,
    "to": 23,
    "total": 23
  }
}