Execution
PDF reports
Download generated files directly. PDF reports include KPIs, charts and tables, and use your workspace brand when whiteLabel is true.
Polling pattern
Generate the report, poll its status, then download.
const { data } = await post("/reports", { type: "serp", websiteId });
let status = "queued";
while (status !== "completed") {
await sleep(2000);
status = (await get(`/reports/${data.id}`)).data.status;
}
const pdf = await fetch(`${base}/reports/${data.id}/download`, { headers });GET
/api/v1/reports/{id}/downloadRead keyDownload the generated file
Authentication: Bearer API key in the Authorization header.
Request
curl "https://rankspire.tech/api/v1/reports/cm1site9x0001/download" \
-H "Authorization: Bearer $RANKSPIRE_KEY"Response
Binary file with Content-Type application/pdf, text/csv or application/json404 not_foundreport missing or not completed yet