Create and start a job to spider and extract pages through a site.
Request
| Authentication | |
|---|---|
token | Cache and insert token into example requests (15d expiry) |
| Request body application/x-www-form-urlencoded | |
|---|---|
name | Job name. This should be a unique identifier and can be used to modify your crawl or retrieve its output. |
seeds | Seed URL(s). Must be URL encoded. Separate multiple URLs with whitespace to spider multiple sites within the same crawl. If the seed contains a non-www subdomain (“https://blog.diffbot.com” or “https://docs.diffbot.com”) Crawl will restrict spidering to the specified subdomain. |
apiUrl | Full Extract API URL through which to process pages. E.g., For example, |
customHeaders | Set multiple custom headers to be used while crawling and processing pages sent to Diffbot APIs. Each header should be sent in its own |
useCanonical | Pass |
obeyRobots | Pass |
restrictDomain | Pass |
useProxies | Set value to |
maxHops | Specify the depth of your crawl. A By default ( (default: |
notifyEmail | Send a message to this email address when the crawl hits the |
notifyWebhook | Pass a URL to be notified when the crawl hits the |
repeat | Specify the number of days as a floating-point (e.g. |
seedRecrawlFrequency | Useful for specifying a frequency, in number of days, to recrawl seed urls, which is independent of the overall recrawl frequency given by |
maxRounds | Specify the maximum number of crawl repeats. By default ( |
urlCrawlPattern | Specify ||-separated strings to limit pages crawled to those whose URLs contain any of the content strings. You can use the exclamation point to specify a negative string, e.g. The use of a |
urlCrawlRegEx | Specify a regular expression to limit pages crawled to those URLs that contain a match to your expression. This will override any |
maxToCrawl | Specify max pages to spider. Default: 100,000. (default: |
maxToCrawlPerSubdomain | Specify max pages to spider per subdomain. Default: no limit (-1) (default: |
crawlDelay | Wait this many seconds between each URL crawled from a single IP address. Specify the number of seconds as an integer or floating-point number (e.g., |
urlProcessPattern | Specify ||-separated strings to limit pages processed to those whose URLs contain any of the content strings. You can use the exclamation point to specify a negative string, e.g. |
urlProcessRegEx | Specify a regular expression to limit pages processed to those URLs that contain a match to your expression. This will override any |
pageProcessPattern | Specify ||-separated strings to limit pages processed to those whose HTML contains any of the content strings. |
maxToProcess | Specify max pages to process through Diffbot APIs. Default: 100,000. (default: |
maxToProcessPerSubdomain | Specify max pages to process per subdomain. Default: no limit (-1) (default: |
onlyProcessIfNew | By default repeat crawls will only process new (previously unprocessed) pages. Set to 0 ( |
Example request
curl --request POST \
--url 'https://api.diffbot.com/v3/crawl?token=<DIFFBOT_TOKEN>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-raw '{"name":"test-crawl","seeds":"https://example.com","apiUrl":"https://api.diffbot.com/v3/analyze"}'
Response
| 200Crawl job created | |
|---|---|
response | |
jobs | |
maxToProcessPerSubdomain | |
jobStatus | |
message | |
status | |
maxHops | |
onlyProcessIfNew | |
downloadJson | |
urlProcessPattern | |
jobCompletionTimeUTC | |
maxRounds | |
restrictDomain | |
type | |
pageCrawlSuccessesThisRound | |
urlCrawlRegEx | |
pageProcessPattern | |
apiUrl | |
useCanonical | |
maxToCrawlPerSubdomain | |
jobCreationTimeUTC | |
repeat | |
downloadUrls | |
obeyRobots | |
roundsCompleted | |
pageCrawlAttempts | |
notifyWebhook | |
pageProcessSuccessesThisRound | |
customHeaders | |
objectsFound | |
roundStartTime | |
urlCrawlPattern | |
maxToProcess | |
seedRecrawlFrequency | |
seeds | |
urlProcessRegEx | |
pageProcessSuccesses | |
urlsHarvested | |
crawlDelay | |
currentTime | |
useProxies | |
maxToCrawl | |
sentJobDoneNotification | |
currentTimeUTC | |
restrictSubdomain | |
name | |
notifyEmail | |
pageCrawlSuccesses | |
pageProcessAttempts |
{
"response": "Successfully added urls for spidering.",
"jobs": [
{
"maxToProcessPerSubdomain": -1,
"jobStatus": {
"message": "Job is initializing.",
"status": 0
},
"maxHops": -1,
"onlyProcessIfNew": 1,
"downloadJson": "https://api.diffbot.com/v3/crawl/download/<REDACTED>.json",
"urlProcessPattern": "",
"jobCompletionTimeUTC": 0,
"maxRounds": -1,
"restrictDomain": 1,
"type": "crawl",
"pageCrawlSuccessesThisRound": 0,
"urlCrawlRegEx": "",
"pageProcessPattern": "",
"apiUrl": "https://api.diffbot.com/v3/analyze",
"useCanonical": 1,
"maxToCrawlPerSubdomain": -1,
"jobCreationTimeUTC": 1726163287,
"repeat": 0,
"downloadUrls": "https://api.diffbot.com/v3/crawl/download/<REDACTED>.csv",
"obeyRobots": 1,
"roundsCompleted": 0,
"pageCrawlAttempts": 0,
"notifyWebhook": "",
"pageProcessSuccessesThisRound": 0,
"customHeaders": {},
"objectsFound": 0,
"roundStartTime": 0,
"urlCrawlPattern": "",
"maxToProcess": 100000,
"seedRecrawlFrequency": -1,
"seeds": "https://example.com",
"urlProcessRegEx": "",
"pageProcessSuccesses": 0,
"urlsHarvested": 0,
"crawlDelay": 0.25,
"currentTime": 1726163288,
"useProxies": 0,
"maxToCrawl": 100000,
"sentJobDoneNotification": 0,
"currentTimeUTC": 1726163288,
"restrictSubdomain": 0,
"name": "test-crawl",
"notifyEmail": "",
"pageCrawlSuccesses": 0,
"pageProcessAttempts": 0
}
]
}
| 505Too many collections for token — the 1,000-crawl limit has been reached | |
|---|---|
errorCode | |
error |
{
"errorCode":505,
"error":"Too many collections for token"
}