List an audit's GTmetrix reports
Answers the audit's GTmetrix reports, environment by page, each read from GTmetrix as you ask; generation is the last request to generate reports, which is how one is followed. Paged by cursor: send next_cursor back as cursor; null means the last page.
Path parameters
The id of an audit. Digits only. At least 1.
Query parameters
Items a page: 1 to 10, default 5.
The next_cursor of the previous answer. Anything that is not a whole number is refused 422 on cursor.
1 adds each filmstrip image to a completed report, as a base64 JPEG. Only 0 and 1 are taken: the words true and false are refused 422 on frames. Defaults to 0.
01Returns
200 One page of reports.
Fields of the 200 answer
Send as cursor to read the next page. Null on the last page.
The last generation requested through the API or MCP. Null when none was.
Fields of each item
With frames=1: each filmstrip image.
Fields of each item
The figures of a completed test.
The environment and the page, such as Corefinity Home.
GTmetrix's own state of the test.
pending: GTmetrix is still testing. gone: GTmetrix no longer has the test. not_started: no test was started for it. unavailable: GTmetrix did not answer for it this time.
completedpendingfailedgonenot_startedunavailableIf it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | scope_required | Use a token with the scope named in scope. |
404 | none | Check the id. You see only what your account can reach. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait for the seconds in Retry-After. |
503 | temporarily_unavailable | The Control Panel could not answer just now. Nothing was started; try again shortly. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl https://manage.corefinity.com/api/performance-audits/5210/gtmetrix-reports \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json"use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->get('https://manage.corefinity.com/api/performance-audits/5210/gtmetrix-reports');
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/performance-audits/5210/gtmetrix-reports', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
},
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.get(
"https://manage.corefinity.com/api/performance-audits/5210/gtmetrix-reports",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
)
data = res.json() if res.content else None{
"generation": null,
"items": [
{
"error": null,
"filmstrip_timings_ms": [
0,
500
],
"metrics": {
"cumulative_layout_shift": 0.12345,
"dom_content_loaded_time_ms": 900,
"first_contentful_paint_ms": 800,
"first_paint_time_ms": 700,
"fully_loaded_time_ms": 2500,
"gtmetrix_grade": "B",
"largest_contentful_paint_ms": 1300,
"performance_score": 88,
"speed_index_ms": 1100,
"structure_score": 91,
"time_to_first_byte_ms": 100,
"time_to_interactive_ms": 1500,
"total_blocking_time_ms": 50
},
"name": "Current host Home",
"state": "completed",
"status": "completed",
"test_id": "Abc12Def"
},
{
"error": null,
"filmstrip_timings_ms": [],
"metrics": null,
"name": "Current host Category",
"state": "started",
"status": "pending",
"test_id": "Ghi34Jkl"
},
{
"error": null,
"filmstrip_timings_ms": [],
"metrics": null,
"name": "Corefinity Home",
"state": null,
"status": "not_started",
"test_id": null
},
{
"error": "The page could not be loaded.",
"filmstrip_timings_ms": [],
"metrics": null,
"name": "Corefinity Category",
"state": "error",
"status": "failed",
"test_id": "Mno56Pqr"
}
],
"next_cursor": null
}{
"message": "Unauthenticated."
}{
"code": "scope_required",
"message": "This access token does not have the destructive scope this needs. Use a token with the destructive scope.",
"reason": "scope_required",
"scope": "destructive"
}{
"message": "Not found."
}{
"code": "invalid",
"errors": {
"cursor": [
"The cursor format is invalid."
]
},
"field": "cursor",
"message": "The cursor format is invalid.",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}{
"code": "temporarily_unavailable",
"message": "GTmetrix reports are not available right now. Try again later.",
"reason": "temporarily_unavailable"
}