Job lifecycle

Job types, statuses, polling, cancellation, failed jobs and notifications.

Job types and endpoints

The lists need project_id. The setup and the scraping lists also accept website_id. Each list shows the newest jobs first. limit sets the number of jobs, from 1 to 100, and the default is 20.

POST /jobs/{job_id}/cancel cancels a job of any type.

Statuses

Each job type goes through its own statuses.

Setup jobs

CREATED → ANALYZING → ESTIMATE_READY → TRAINING → COMPLETED

The analysis and the training move the job forward without action from you. A setup job can skip ANALYZING or TRAINING when DeepScout already knows the website. See Add a website.

Scrape and matching jobs

AWAITING_APPROVAL → APPROVED → RUNNING → SETTLING → EXPORTING → COMPLETED
StatusDescription
AWAITING_APPROVALThe job has a quote in estimate. It waits for your approval.
APPROVEDYou approved the quote. The API holds the cap from your credit and starts the work. The approve response usually shows RUNNING already.
RUNNINGThe work runs. scrape_progress or matching_progress shows the progress.
SETTLINGThe work is complete. The API calculates the charge.
EXPORTINGThe API writes the export files of the project.
COMPLETEDThe data is in the export files. settlement shows the charge.

A free matching sample has a zero estimate. It starts without your approval.

End statuses

COMPLETED, FAILED and CANCELLED are end statuses. A job in an end status does not change again. finished_at shows when it got there.

  • FAILED can end a job of any type. See Failed jobs.
  • CANCELLED ends a job that you cancelled, a quote that did not change for 7 days, or the waiting jobs of a removed website.

Common fields

All job responses have these fields. A field without a value is not in the response.

FieldDescription
job_idThe ID of the job.
job_typeWEBSITE_SETUP, FULL_SCRAPE, URL_SCRAPE or MATCHING.
statusThe current status.
project_idThe project of the job.
website_idThe website of a setup or scrape job. A setup job gets it when the analysis is complete.
estimateThe quote of a paid job. See Pricing.
approvalWho approved the quote (approved_by) and when (approved_at).
settlementThe charge: quantity, amount, currency, capped and settled_at. A failed job settles at zero.
error, error_codeWhy the job failed.
contact_reasonOn a failed job: the reason to send in a contact request.
contact_request_idThe contact request that you sent about the job.
created_at, updated_at, finished_atWhen the job was created, changed last, and ended.

Website state

GET /websites shows each website with one job: the newer of its setup job and its newest full scrape that is not cancelled. URL scrapes do not change it. The console shows the state of the website from this job:

job.statusConsole status
CREATED, ANALYZINGAnalyzing
ESTIMATE_READY, TRAININGTraining
COMPLETED of the setup job, or AWAITING_APPROVALReady
APPROVED, RUNNING, SETTLINGScraping
EXPORTINGExporting
COMPLETED of a full scrapeCompleted
FAILED with contact_reason WEBSITE_TOO_LARGECustom setup
FAILEDFailed
CANCELLEDCancelled

The website also has scraped_at, the end of its last completed scrape, and added_at, the start of its setup.

Polling

The API has no webhooks yet. To follow a job, read it again at an interval:

JobInterval
Setup job30 to 60 seconds
Scrape or matching1 to 5 minutes
Top-up statusA few seconds, for up to 2 minutes

Stop when the job is in an end status, or in AWAITING_APPROVAL, which waits for you.

To follow all websites of a project with one request, read GET /websites. For the scrape jobs of one website, read GET /jobs/scraping with website_id.

Cancel a job

Send POST /jobs/{job_id}/cancel. You can cancel:

  • A setup job before it is complete. You do not get the analysis back.
  • A scrape or a matching that waits for approval (AWAITING_APPROVAL). This removes the quote.

You cannot cancel a paid job after its approval, or a free matching sample. The API then answers 409 JOB_NOT_CANCELLABLE.

A quote that you do not approve for 7 days changes to CANCELLED.

Failed jobs

A failed job has an error text, an error_code and a contact_reason.

error_codeJob typecontact_reason
WEBSITE_TOO_LARGESetupWEBSITE_TOO_LARGE (sales team)
ANALYSIS_FAILEDSetupJOB_FAILED (support team)
TRAINING_FAILEDSetupJOB_FAILED (support team)
SCRAPE_FAILEDFull or URL scrapeJOB_FAILED (support team)
MATCHING_FAILEDMatchingJOB_FAILED (support team)

A failed paid job costs nothing. To ask for help, send POST /contact-requests:

{
  "reason": "JOB_FAILED",
  "job_id": "jobreq_01k7d0f1g2h3j4k5m6n7p8q9r0",
  "phone": "+420 123 456 789",
  "message": "The scrape failed two times."
}
  • reason must be the contact_reason of the job. If not, the API answers 409 CONTACT_REASON_MISMATCH.
  • phone is optional, with 6 to 20 digits. Without it, the team writes to the email of your account.
  • message is optional, up to 2,000 characters.

The API answers 201 Created. A second request about the same job returns the first request with 200 OK. After the request, the job shows its contact_request_id.

Email notifications

DeepScout sends an email to the user who started the job:

EventEmail
The training of a website is completeThe website is ready
A setup job failsThe setup failed
A website has more than 2,000,000 productsAn offer from the sales team
A scrape or a matching is COMPLETEDThe data is ready
A scrape or a matching failsThe job failed

There are no emails for quotes, cancellations or top-ups.

On this page