🚀 1,000 free API creditsTry it free →
Docs/Download Results
GET/api/v1/files/:jobId

Download Results

Retrieve a previously scraped result by its job_id. Use this endpoint to download screenshots, PDFs, or large HTML files returned from the main scrape endpoint.

How Results Are Stored

1

Local disk (up to 2h)

Results are saved on the server immediately after scraping and served instantly from local disk.

2

Remote backup

Files are backed up to remote storage so you can still fetch them after local TTL expires.

3

Expired (410)

Once both local and remote copies are deleted, the endpoint returns 410 Gone.

The result_url field returned by the scrape endpoint already contains the full download URL. You only need to call this endpoint manually when downloading screenshots or PDFs, or when the file is no longer in the inline response body.

Path Parameters

ParameterTypeDescription
jobIdrequiredstringThe job_id returned by the scrape endpoint.

Code Examples

Python
import requests

JOB_ID  = "job_abc123def456"  # from the scrape response
API_KEY = "YOUR_API_KEY"

response = requests.get(
    f"https://scrape.sparkproxy.io/api/v1/files/{JOB_ID}",
    headers={"X-API-Key": API_KEY},
)

# Save to file (works for HTML, PNG, PDF, etc.)
ext = response.headers.get("Content-Type", "").split("/")[-1] or "bin"
with open(f"{JOB_ID}.{ext}", "wb") as f:
    f.write(response.content)
print(f"Saved {JOB_ID}.{ext}")

End-to-End: Scrape then Download

Take a screenshot, get the result_url from the JSON response, then download the PNG.

Python
import requests

API_KEY = "YOUR_API_KEY"
BASE    = "https://scrape.sparkproxy.io"

# Step 1: Scrape with json_response to get the job_id
scrape = requests.get(
    f"{BASE}/api/v1",
    headers={"X-API-Key": API_KEY},
    params={
        "url":           "https://example.com",
        "render_js":     "true",
        "format":        "screenshot",
        "json_response": "true",
    }
).json()

job_id     = scrape["job_id"]
result_url = scrape["result_url"]
print(f"Job: {job_id}  expires: {scrape['expires_at']}")

# Step 2: Download the screenshot
img = requests.get(result_url, headers={"X-API-Key": API_KEY})
with open("screenshot.png", "wb") as f:
    f.write(img.content)
print("Saved screenshot.png")

Response Headers

HeaderValuesDescription
Content-Typetext/html, text/markdown, image/png, application/pdf, application/jsonMatches the format of the original scrape request.
X-Sourcelocal, hetznerWhere the file was served from: local disk or remote backup.
Content-Dispositioninline; filename="job_abc123.png"Filename hint for browser download.

Status Codes

StatusMeaning
200File found and returned.
401Missing or invalid API key.
404File not found or does not belong to this API key.
410File has expired from both local and remote storage.
503Remote backup fetch failed.