PDF Generation

Scraping Fish API allows you to generate a PDF file from any webpage. To do so, you need to provide the pdf query parameter and set it to true.

Example

To generate a PDF of example.com, send a request with the pdf=true query parameter.

GET
/api/v1/
import requests

payload = {
  "api_key": "[your API key]",
  "url": "https://www.example.com",
  "pdf": True,
}

response = requests.get("https://scraping.narf.ai/api/v1/", params=payload)
with open("./page.pdf", "wb") as f:
  f.write(response.content)

The resulting PDF file will be returned as bytes. In the example above, it is saved to page.pdf file.