Page with an RFC 5988 Link header
GET
https://api.testingapis.com/api/pagination/linkPage with an RFC 5988 Link header (GitHub style, 1-based).
The body is a plain array. Navigation is in the Link header (rel="next", prev, first, last, with absolute URLs), plus X-Total-Count. A page past the end returns an empty array.
Parameters 2
| Name | Type | Description |
|---|---|---|
page | query · integer (int32) | Page number, starting at 1 (default 1). Default: 1. |
per_page | query · integer (int32) | Page size, sent as the per_page query parameter (1-100, default 10). Default: 10. |
Responses
- 200
- One page.
Example
Request
curl -X GET "https://api.testingapis.com/api/pagination/link?page=1&per_page=3"Response200 OK
X-Total-Count: 100
Link: <https://api.testingapis.com/api/pagination/link?page=2&per_page=3>; rel="next", <https://api.testingapis.com/api/pagination/link?pa…
[
{
"id": 1,
"name": "Smart Headset",
"category": "electronics",
"price": 42.01,
"createdAt": "2026-01-01T21:00:00Z"
},
{
"id": 2,
"name": "Compact Speaker",
"category": "outdoors",
"price": 79.02,
"createdAt": "2026-01-02T10:00:00Z"
… (1 more lines)Code examples
JavaScript (fetch)
const response = await fetch("https://api.testingapis.com/api/pagination/link?page=1&per_page=3");
console.log(response.status, await response.text());Python (requests)
import requests
response = requests.request(
"GET",
"https://api.testingapis.com/api/pagination/link?page=1&per_page=3",
allow_redirects=False,
)
print(response.status_code, response.text)Java (HttpClient)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newBuilder()
.followRedirects(HttpClient.Redirect.NEVER)
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.testingapis.com/api/pagination/link?page=1&per_page=3"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}