ScrapeThis API Docs

Schedules

Manage cron-based schedules for automated spider runs.

GET /api/v1/schedules

List all schedules for the authenticated user.

Example Request

cURL
"text">-green-400">curl https://scrapethis.app/api/v1/schedules \
  "text-cyan-400">-H "Authorization: Bearer YOUR_API_KEY"

Response

200 OK
[
  {
    "id": "schedule-uuid",
    "spider_id": "spider-uuid",
    "cron_expression": "0 */6 * * *",
    "timezone": "UTC",
    "enabled": true,
    "user_id": "user-uuid",
    "created_at": "2025-01-15T10: 30: 00Z",
    "spider": {
      "id": "spider-uuid",
      "name": "my-spider"
    }
  }
]

Error Responses

401 Invalid or missing API key
POST /api/v1/schedules

Create a new schedule for a spider.

Request Body

TypeScript
{
  spider_id: "text-purple-400">string;          // required
  cron_expression: "text-purple-400">string;    // required — e.g. "0 */6 * * *"
  timezone?: "text-purple-400">string;          // default: "UTC"
  enabled?: "text-purple-400">boolean;          // default: "text-purple-400">true
}

Example Request

cURL
"text">-green-400">curl "text-cyan-400">-X POST https://scrapethis.app/api/v1/schedules \
  "text-cyan-400">-H "Authorization: Bearer YOUR_API_KEY" \
  "text-cyan-400">-H "Content">-Type: application/json" \
  "text-cyan-400">-d '{
    "spider_id": "spider">-uuid",
    "cron_expression": "0 9 * * 1">-5",
    "timezone": "America/New_York"
  }'

Response

200 OK
{
  "id": "new-schedule-uuid",
  "spider_id": "spider-uuid",
  "cron_expression": "0 9 * * 1-5",
  "timezone": "America/New_York",
  "enabled": true,
  "user_id": "user-uuid",
  "created_at": "2025-01-15T10: 30: 00Z"
}

Error Responses

400 Missing spider_id or cron_expression
GET /api/v1/schedules/{id}

Get a single schedule by ID.

Example Request

cURL
"text">-green-400">curl https://scrapethis.app/api/v1/schedules/SCHEDULE_ID \
  "text-cyan-400">-H "Authorization: Bearer YOUR_API_KEY"

Response

200 OK
{
  "id": "schedule-uuid",
  "spider_id": "spider-uuid",
  "cron_expression": "0 */6 * * *",
  "timezone": "UTC",
  "enabled": true,
  "user_id": "user-uuid",
  "created_at": "2025-01-15T10: 30: 00Z",
  "spider": {
    "id": "spider-uuid",
    "name": "my-spider"
  }
}

Error Responses

404 Schedule not found
PATCH /api/v1/schedules/{id}

Update a schedule. Send only the fields you want to change.

Request Body

TypeScript
{
  cron_expression?: "text-purple-400">string;
  timezone?: "text-purple-400">string;
  enabled?: "text-purple-400">boolean;
}

Example Request

cURL
"text">-green-400">curl "text-cyan-400">-X PATCH https://scrapethis.app/api/v1/schedules/SCHEDULE_ID \
  "text-cyan-400">-H "Authorization: Bearer YOUR_API_KEY" \
  "text-cyan-400">-H "Content">-Type: application/json" \
  "text-cyan-400">-d '{"enabled": false}'

Response

200 OK
{
  "id": "schedule-uuid",
  "spider_id": "spider-uuid",
  "cron_expression": "0 */6 * * *",
  "timezone": "UTC",
  "enabled": false,
  "user_id": "user-uuid",
  "created_at": "2025-01-15T10: 30: 00Z"
}

Error Responses

404 Schedule not found
DELETE /api/v1/schedules/{id}

Delete a schedule.

Example Request

cURL
"text">-green-400">curl "text-cyan-400">-X DELETE https://scrapethis.app/api/v1/schedules/SCHEDULE_ID \
  "text-cyan-400">-H "Authorization: Bearer YOUR_API_KEY"

Response

200 OK
{
  "ok": true
}

Error Responses

404 Schedule not found