Skip to content
Examples

Add Tasks

Add YouTube video URLs to scrape comments from

The v1 API, for batchesSquids, tasks and runs: many calls on a schedule, delivered where you work. For one call that answers in seconds, use the API v2.
POSThttps://api.lobstr.io/v1/tasks
Crawler ID: 66e9fbe07ae0a543576dc6ff241c229c

Headers

Authorizationstringheaderrequired

Your API authentication token. Value: Token YOUR_API_KEY

Content-Typestringheaderrequired

Must be application/json. Value: application/json

Body

squidstringrequired

Hash of the squid to add tasks to

tasksarrayrequired

Array of task objects to add

tasks[].urlstringrequired

YouTube video URL. Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ

URL Format

The url field accepts standard YouTube video URLs:

https://www.youtube.com/watch?v=VIDEO_ID
https://youtu.be/VIDEO_ID

Code Examples

curl -X POST "https://api.lobstr.io/v1/tasks" \
  -H "Authorization: Token YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "squid": "YOUR_SQUID_HASH",
    "tasks": [
      {"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"},
      {"url": "https://www.youtube.com/watch?v=ANOTHER_VIDEO_ID"}
    ]
  }'

Response

201
{
  "tasks": [
    {
      "id": "TASK_HASH",
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      "status": "pending"
    }
  ]
}