import requests
url = "https://api.pdfshift.io/v3/logs"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"logs": {
"has_more": true,
"data": [
{
"id": 12345500,
"duration": 2191,
"executed": 1764753251000,
"credits": 1,
"sandbox": false,
"filesize": 305345,
"error": null,
"code": 200,
"user_agent": "Python/3.9 aiohttp/3.10.5",
"request_id": "40bad9f3-0eb8-4de3-82de-3886ff9522ed",
"query": null
},
{
"id": 12345501,
"duration": 2385,
"executed": 1764753169000,
"credits": 1,
"sandbox": false,
"filesize": 310593,
"error": null,
"code": 200,
"user_agent": "Python/3.9 aiohttp/3.10.5",
"request_id": "e8079824-f786-45b1-a8cb-a35fe916ea8d",
"query": null
},
{
"id": 12345502,
"duration": 2377,
"executed": 1764752870000,
"credits": 1,
"sandbox": false,
"filesize": 306883,
"error": null,
"code": 200,
"user_agent": "Python/3.9 aiohttp/3.10.5",
"request_id": "22bf9320-455a-4e91-bda4-b90cfb0e4eb0",
"query": null
},
{
"id": 12345503,
"duration": 2209,
"executed": 1764752729000,
"credits": 1,
"sandbox": false,
"filesize": 334962,
"error": null,
"code": 200,
"user_agent": "Python/3.9 aiohttp/3.10.5",
"request_id": "6ac98706-9dbe-4ba2-acaf-3ad2313048d6",
"query": null
},
{
"id": 12345504,
"duration": 1419,
"executed": 1764616844000,
"credits": 1,
"sandbox": false,
"filesize": 300952,
"error": null,
"code": 200,
"user_agent": "Python/3.9 aiohttp/3.10.5",
"request_id": "63a0fdbf-a07c-4c65-a8f7-4ad09db5530c",
"query": null
}
],
"limit": 5,
"page": 0,
"total": 233
}
}import requests
url = "https://api.pdfshift.io/v3/logs"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"logs": {
"has_more": true,
"data": [
{
"id": 12345500,
"duration": 2191,
"executed": 1764753251000,
"credits": 1,
"sandbox": false,
"filesize": 305345,
"error": null,
"code": 200,
"user_agent": "Python/3.9 aiohttp/3.10.5",
"request_id": "40bad9f3-0eb8-4de3-82de-3886ff9522ed",
"query": null
},
{
"id": 12345501,
"duration": 2385,
"executed": 1764753169000,
"credits": 1,
"sandbox": false,
"filesize": 310593,
"error": null,
"code": 200,
"user_agent": "Python/3.9 aiohttp/3.10.5",
"request_id": "e8079824-f786-45b1-a8cb-a35fe916ea8d",
"query": null
},
{
"id": 12345502,
"duration": 2377,
"executed": 1764752870000,
"credits": 1,
"sandbox": false,
"filesize": 306883,
"error": null,
"code": 200,
"user_agent": "Python/3.9 aiohttp/3.10.5",
"request_id": "22bf9320-455a-4e91-bda4-b90cfb0e4eb0",
"query": null
},
{
"id": 12345503,
"duration": 2209,
"executed": 1764752729000,
"credits": 1,
"sandbox": false,
"filesize": 334962,
"error": null,
"code": 200,
"user_agent": "Python/3.9 aiohttp/3.10.5",
"request_id": "6ac98706-9dbe-4ba2-acaf-3ad2313048d6",
"query": null
},
{
"id": 12345504,
"duration": 1419,
"executed": 1764616844000,
"credits": 1,
"sandbox": false,
"filesize": 300952,
"error": null,
"code": 200,
"user_agent": "Python/3.9 aiohttp/3.10.5",
"request_id": "63a0fdbf-a07c-4c65-a8f7-4ad09db5530c",
"query": null
}
],
"limit": 5,
"page": 0,
"total": 233
}
}Number of items to return (between 5 and 100, defaults to 20)
5 <= x <= 100Filter logs by status: 'error', 'success', or 'all' (default: 'all')
error, success, all API Key to filter the results to. Default is null, which includes all requests from all API keys.
Returns the events that occurred before the given time. Format is ISO datetime.