Using the Scraperr API
Summary
The Scraperr API is a RESTful API that allows you to submit scraping jobs, view the status of the jobs, and download the results. This guide will cover how to use the API to submit a scraping job, and how to query the results. The docs for the API are viewable via Swagger UI at http://localhost:8000/docs
.
Submitting a Scraping Job
Using your favorite HTTP client, you can submit a scraping job to the API. Here is an example using python
:
Which should return a response like this:
Checking the Status of a Job
You would want to check the status of a job to see if it has been completed, or if there are any errors. You can do this by making a GET
request to the /api/job/{id}
endpoint. This will return the Job object from the database. Here is an example using python
:
Updating a Job
You can update a job by making a POST
request to the /api/job/{id}
endpoint. This will return the updated Job object from the database. Here is an example using python
:
Deleting a Job
You can delete a job by making a POST
request to the /api/delete-scrape-jobs
endpoint. This will deleted the ids passed in the ids
field from the database. Here is an example using python
: