Skip to content
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 key

Download 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/json
  • 404 not_found report missing or not completed yet