Sites
Export PDF Report
Generates a downloadable PDF analytics report for a date range.
GET /api/sites/:site/export/pdfGenerates a downloadable PDF analytics report for a date range.
Path Parameters
Prop
Type
Query Parameters
Prop
Type
Response
Returns a binary PDF file (Content-Type: application/pdf). Save the response body to a .pdf file rather than parsing it as JSON.
curl -X GET "https://app.rybbit.io/api/sites/123/export/pdf?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York" \
-H "Authorization: Bearer your_api_key_here" \
-o report.pdfconst response = await fetch(
'https://app.rybbit.io/api/sites/123/export/pdf?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York',
{
headers: {
'Authorization': 'Bearer your_api_key_here'
}
}
);
const blob = await response.blob();import requests
response = requests.get(
'https://app.rybbit.io/api/sites/123/export/pdf',
params={
'start_date': '2024-01-01',
'end_date': '2024-01-31',
'time_zone': 'America/New_York'
},
headers={
'Authorization': 'Bearer your_api_key_here'
}
)
with open('report.pdf', 'wb') as f:
f.write(response.content)$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.rybbit.io/api/sites/123/export/pdf?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer your_api_key_here'
]);
$response = curl_exec($ch);
curl_close($ch);
file_put_contents('report.pdf', $response);require 'net/http'
uri = URI('https://app.rybbit.io/api/sites/123/export/pdf?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer your_api_key_here'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
File.binwrite('report.pdf', res.body)req, _ := http.NewRequest("GET", "https://app.rybbit.io/api/sites/123/export/pdf?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York", nil)
req.Header.Set("Authorization", "Bearer your_api_key_here")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
out, _ := os.Create("report.pdf")
defer out.Close()
io.Copy(out, resp.Body)let client = reqwest::Client::new();
let res = client
.get("https://app.rybbit.io/api/sites/123/export/pdf?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York")
.header("Authorization", "Bearer your_api_key_here")
.send()
.await?;
let bytes = res.bytes().await?;
std::fs::write("report.pdf", &bytes)?;HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://app.rybbit.io/api/sites/123/export/pdf?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York"))
.header("Authorization", "Bearer your_api_key_here")
.GET()
.build();
HttpResponse<Path> response = client.send(request, HttpResponse.BodyHandlers.ofFile(Path.of("report.pdf")));using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
var response = await client.GetAsync("https://app.rybbit.io/api/sites/123/export/pdf?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York");
var bytes = await response.Content.ReadAsByteArrayAsync();
File.WriteAllBytes("report.pdf", bytes);