Skip to content
Examples

Add Tasks

Add tasks to your YouTube Search Scraper squid

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

Add URLs or inputs to your YouTube Search Scraper squid.

Crawler ID: 2bfd28f2e9d6012d6d557072fda474da

Headers

Authorizationstringheaderrequired

Your API authentication token. Value: Token YOUR_API_KEY

Content-Typestringheaderrequired

Must be application/json. Value: application/json

Body

squidstringrequired

Hash ID of your squid.

tasksarrayrequired

Array of task objects.

Task Fields

tasks[].url/keywordstringrequired

A YouTube video URL, a YouTube channel URL (@handle, /c/Name, /channel/UC..., /user/Name, or a bare custom URL -- optionally with a /videos, /shorts, /streams, or /playlists suffix to list that tab instead of the channel's profile), a hashtag URL, a playlist URL, a YouTube search-results URL, or just plain search-query text. Anything not recognized as a supported YouTube URL is searched verbatim, exactly like typing it into YouTube's search bar (this deliberately includes non-YouTube URLs, e.g. "google.com" is searched as text, not rejected). Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ

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/keyword": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}
    ]
  }'

Response

200
{"duplicated_count": 0, "tasks": [{"id": "TASK_HASH", "is_active": true, "params": {"url/keyword": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}, "object": "task"}]}