Actions
Run PageSpeed
POST
/api/v1/projects/{id}/checks/pagespeed
Requires view-performance.
- API key access
- Read and write
- Project permission
- View performance
- Success
- 202 — Job queued (or an identical one is already queued)
Parameters
Path
| Parameter | Type | Notes |
|---|---|---|
id required |
string | Project id |
Request body
JSON, with Content-Type: application/json.
| Field | Type | Notes |
|---|---|---|
device |
"mobile" | "desktop" | default "mobile" |
Example request
Replace tk_live_YOUR_KEY with your API key and the ids with your own.
curl -X POST 'https://trackerv2.marketingplanet.global/api/v1/projects/6650a4c2e1b3d5f7a9c1e301/checks/pagespeed' \
-H 'Authorization: Bearer tk_live_YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{
"device": "desktop"
}'
const response = await fetch('https://trackerv2.marketingplanet.global/api/v1/projects/6650a4c2e1b3d5f7a9c1e301/checks/pagespeed', {
method: 'POST',
headers: {
Authorization: 'Bearer tk_live_YOUR_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"device": "desktop"
}),
});
const result = await response.json();
if (!response.ok) throw new Error(`${result.error.code}: ${result.error.message}`);
console.log(result.data);
import requests
response = requests.post(
"https://trackerv2.marketingplanet.global/api/v1/projects/6650a4c2e1b3d5f7a9c1e301/checks/pagespeed",
headers={"Authorization": "Bearer tk_live_YOUR_KEY"},
json={
"device": "desktop",
},
)
result = response.json()
if not response.ok:
raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result["data"])
Example response
{
"data": {
"jobId": "6654e8a6c5f7b9d1e3a5c701",
"kind": "project-pagespeed",
"status": "queued",
"deduplicated": false,
"statusUrl": "/api/v1/jobs/6654e8a6c5f7b9d1e3a5c701"
}
}
Response fields
| Field | Type | Notes |
|---|---|---|
data |
object | |
data.jobId |
string | |
data.kind |
string | |
data.status |
"queued" | "running" | |
data.deduplicated |
boolean | True when an identical job was already queued or running |
data.statusUrl |
string |
Errors
Besides the errors any request can return (bad or missing key, plan, scope, rate limit), this endpoint can return:
| Status | error.code | Meaning |
|---|---|---|
| 404 | not-found | The resource does not exist or you cannot open it. Tracker does not reveal which. |
| 403 | flag-viewPerformance | Your project membership does not include viewing performance. |
| 403 | forbidden | The account is restricted: reads still work, but changes that add or modify projects, pages or monitors are blocked (error.accountStatus is restricted). |
Errors always look like { "error": { "code": "…", "message": "…" } }. See Errors & limits.