Extract a list of URLs asynchronously
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 will be used to modify your bulk job and retrieve its output. |
urls | Space-delimited list of URLs to process. If you are on the Startup plan, jobs must contain at least 50 URLs. |
apiUrl | The full Extract (or Custom) API to be used for each URL. For instance, to process each URL via the Article API, supply |
customHeaders | Set custom headers to be used for processing each URL. Send multiple |
notifyEmail | Send a message to this email address when the bulk job completes. |
notifyWebhook | Pass a URL to be notified when the bulk job completes. You will receive a POST with a JSON response. |
obeyRobots | Pass |
repeat | Specify the number of days as a floating-point (e.g. |
pageProcessPattern | Enter ||-separated strings to limit pages processed to those whose HTML contains any of the content strings. If a page does not contain at least one of the strings, it will be ignored. |
Example request
curl --request POST \
--url 'https://api.diffbot.com/v3/bulk?token=<DIFFBOT_TOKEN>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-raw '{}'
Response
| 200Bulk job created | |
|---|---|
response | |
jobs | |
jobStatus | |
message | |
status | |
maxHops | |
downloadJson | |
urlProcessPattern | |
jobCompletionTimeUTC | |
maxRounds | |
type | |
pageCrawlSuccessesThisRound | |
urlCrawlRegEx | |
pageProcessPattern | |
apiUrl | |
useCanonical | |
jobCreationTimeUTC | |
repeat | |
downloadUrls | |
obeyRobots | |
roundsCompleted | |
pageCrawlAttempts | |
notifyWebhook | |
pageProcessSuccessesThisRound | |
customHeaders | |
objectsFound | |
roundStartTime | |
urlCrawlPattern | |
seedRecrawlFrequency | |
urlProcessRegEx | |
pageProcessSuccesses | |
urlsHarvested | |
crawlDelay | |
currentTime | |
useProxies | |
sentJobDoneNotification | |
currentTimeUTC | |
name | |
notifyEmail | |
pageCrawlSuccesses | |
pageProcessAttempts |
{
"response": "Successfully added urls for spidering.",
"jobs": [
{
"jobStatus": {
"message": "Job is initializing.",
"status": 0
},
"maxHops": -1,
"downloadJson": "...json",
"urlProcessPattern": "",
"jobCompletionTimeUTC": 0,
"maxRounds": -1,
"type": "bulk",
"pageCrawlSuccessesThisRound": 0,
"urlCrawlRegEx": "",
"pageProcessPattern": "",
"apiUrl": "https://api.diffbot.com/v3/analyze",
"useCanonical": 1,
"jobCreationTimeUTC": 1649950325,
"repeat": 0,
"downloadUrls": "...csv",
"obeyRobots": 1,
"roundsCompleted": 0,
"pageCrawlAttempts": 0,
"notifyWebhook": "",
"pageProcessSuccessesThisRound": 0,
"customHeaders": {},
"objectsFound": 0,
"roundStartTime": 0,
"urlCrawlPattern": "",
"seedRecrawlFrequency": -1,
"urlProcessRegEx": "",
"pageProcessSuccesses": 0,
"urlsHarvested": 0,
"crawlDelay": -1,
"currentTime": 1649950325,
"useProxies": 0,
"sentJobDoneNotification": 0,
"currentTimeUTC": 1649950325,
"name": "bulkTest",
"notifyEmail": "",
"pageCrawlSuccesses": 0,
"pageProcessAttempts": 0
}
]
}
| 401Token missing or invalid | |
|---|---|
errorCode | |
error |
{
"errorCode": 401,
"error": "Not authorized API token."
}
| 500No URLs were found in the request | |
|---|---|
errorCode | |
error |
{
"errorCode": "500",
"error": "no urls found"
}
| 505Job name rejected — names can consist only of letters, numbers, underscores, or hyphens | |
|---|---|
errorCode | |
error |
{
"errorCode": 505,
"error": "Crawl names can consist only of letters, numbers, underscores or hyphens."
}