---
title: "Get Spider by ID"
method: GET
path: "/spiders/{id}"
tags: ["Spiders"]
---

# Get Spider by ID

`GET /spiders/{id}`

Get a single spider by ID

## Path parameters

- `id` string, objectid, required — The ID of the item to get

## Response `200`

OK

- ControllersResponseGithubModelsSpiderDTO
  - `data` ModelsSpiderDTO
    - `Spider` ModelsSpider — The spider data to create
      - `_id` string, objectid — ID
      - `cmd` string — Execute command
      - `col_id` string, objectid — Data collection id
      - `col_name` string — Data collection name
      - `created_at` string, date-time — Created timestamp
      - `created_by` string, objectid — Created by
      - `database_id` string, objectid — Database Id
      - `db_name` string — Database name
      - `description` string — Description
      - `git_id` string, objectid — Related Git ID
      - `git_root_path` string — Git root path
      - `mode` 'random' | 'all' | 'selected-nodes' — Default task mode
      - `name` string — Spider name
      - `node_group_ids` string[] — Default node group ids, used in selected-node-groups mode
      - `node_ids` string[] — Default node ids, used in selected-nodes mode
      - `param` string — Default task param
      - `priority` integer — Priority
      - `project_id` string, objectid — Project ID
      - `template` string — Spider template
      - `template_params` ModelsSpiderTemplateParams — Spider template params
        - `allowed_domains` string — Allowed domains
        - `project_name` string — Project name
        - `spider_name` string — Spider name
        - `start_urls` string — Start urls
      - `updated_at` string, date-time — Updated timestamp
      - `updated_by` string, objectid — Updated by
    - `database` ModelsDatabase — The data to update
      - `_id` string, objectid — ID
      - `active` boolean — Active
      - `active_ts` string, date-time — Active at
      - `cassandra_params` object — Cassandra params
        - `keyspace` string — Keyspace
      - `created_at` string, date-time — Created timestamp
      - `created_by` string, objectid — Created by
      - `data_source` string — Data source
      - `database` string — Database
      - `description` string — Description
      - `error` string — Error
      - `hive_params` object — Hive params
        - `auth` string — Auth
      - `host` string — Host
      - `is_default` boolean
      - `mongo_params` object — Mongo params
        - `auth_mechanism` string — Auth mechanism
        - `auth_source` string — Auth source
      - `name` string — Name
      - `password` string
      - `port` integer — Port
      - `postgres_params` object — Postgres params
        - `ssl_mode` string — SSL mode
      - `redis_params` object — Redis params
        - `db` integer — DB
      - `snowflake_params` object — Snowflake params
        - `account` string — Account
        - `role` string — Role
        - `schema` string — Schema
        - `warehouse` string — Warehouse
      - `status` string — Status
      - `updated_at` string, date-time — Updated timestamp
      - `updated_by` string, objectid — Updated by
      - `uri` string — URI
      - `use_orm` boolean — Use ORM instead of legacy database service (only for MySQL, PostgreSQL, SQL Server)
      - `username` string — Username
    - `git` ModelsGit — The data to update
      - `_id` string, objectid — ID
      - `auth_type` string — Auth type
      - `auto_pull` boolean — Auto pull
      - `clone_logs` string[] — Clone logs
      - `created_at` string, date-time — Created timestamp
      - `created_by` string, objectid — Created by
      - `current_branch` string — Current branch
      - `error` string — Error
      - `name` string — Name
      - `password` string — Password
      - `refs` VcsGitRef[] — Refs
        - `full_name` string
        - `hash` string
        - `name` string
        - `remote_track` string
        - `timestamp` string, date-time
        - `type` string
      - `refs_updated_at` string, date-time — Refs updated at
      - `status` string — Status
      - `updated_at` string, date-time — Updated timestamp
      - `updated_by` string, objectid — Updated by
      - `url` string — URL
      - `username` string — Username
    - `last_task` ModelsTask — The data to update
      - `_id` string, objectid — ID
      - `cmd` string — Command
      - `created_at` string, date-time — Created timestamp
      - `created_by` string, objectid — Created by
      - `error` string — Error
      - `mode` string — Mode
      - `node` ModelsNode — The data to update
        - `_id` string, objectid — ID
        - `active` boolean — Active
        - `active_at` string, date-time — Active at
        - `created_at` string, date-time — Created timestamp
        - `created_by` string, objectid — Created by
        - `current_runners` integer — Current runners
        - `description` string — Description
        - `enabled` boolean — Enabled
        - `hostname` string — Hostname
        - `ip` string — IP
        - `is_master` boolean — Is master
        - `key` string — Type
        - `mac` string — MAC
        - `max_runners` integer — Max runners
        - `name` string — Name
        - `status` string — Status
        - `updated_at` string, date-time — Updated timestamp
        - `updated_by` string, objectid — Updated by
      - `node_group_ids` string[]
      - `node_id` string, objectid — Node ID
      - `node_ids` string[]
      - `param` string — Parameter
      - `pid` integer — Process ID
      - `priority` integer — Priority
      - `schedule` ModelsSchedule — The data to update
        - `_id` string, objectid — ID
        - `cmd` string — Cmd
        - `created_at` string, date-time — Created timestamp
        - `created_by` string, objectid — Created by
        - `cron` string — Cron
        - `description` string — Description
        - `enabled` boolean — Enabled
        - `entry_id` integer — Entry ID
        - `execution_strategy` string — Execution Strategy
        - `mode` string — Mode
        - `name` string — Name
        - `node_group_ids` string[] — Node Group IDs
        - `node_ids` string[] — Node IDs
        - `param` string — Param
        - `priority` integer — Priority
        - `spider` ModelsSpider — The spider data to create
          - `_id` string, objectid — ID
          - `cmd` string — Execute command
          - `col_id` string, objectid — Data collection id
          - `col_name` string — Data collection name
          - `created_at` string, date-time — Created timestamp
          - `created_by` string, objectid — Created by
          - `database_id` string, objectid — Database Id
          - `db_name` string — Database name
          - `description` string — Description
          - `git_id` string, objectid — Related Git ID
          - `git_root_path` string — Git root path
          - `mode` 'random' | 'all' | 'selected-nodes' — Default task mode
          - `name` string — Spider name
          - `node_group_ids` string[] — Default node group ids, used in selected-node-groups mode
          - `node_ids` string[] — Default node ids, used in selected-nodes mode
          - `param` string — Default task param
          - `priority` integer — Priority
          - `project_id` string, objectid — Project ID
          - `template` string — Spider template
          - `template_params` ModelsSpiderTemplateParams — Spider template params
            - `allowed_domains` string — Allowed domains
            - `project_name` string — Project name
            - `spider_name` string — Spider name
            - `start_urls` string — Start urls
          - `updated_at` string, date-time — Updated timestamp
          - `updated_by` string, objectid — Updated by
        - `spider_id` string, objectid — Spider ID
        - `updated_at` string, date-time — Updated timestamp
        - `updated_by` string, objectid — Updated by
      - `schedule_id` string, objectid — Schedule ID
      - `spider` ModelsSpider — The spider data to create
        - `_id` string, objectid — ID
        - `cmd` string — Execute command
        - `col_id` string, objectid — Data collection id
        - `col_name` string — Data collection name
        - `created_at` string, date-time — Created timestamp
        - `created_by` string, objectid — Created by
        - `database_id` string, objectid — Database Id
        - `db_name` string — Database name
        - `description` string — Description
        - `git_id` string, objectid — Related Git ID
        - `git_root_path` string — Git root path
        - `mode` 'random' | 'all' | 'selected-nodes' — Default task mode
        - `name` string — Spider name
        - `node_group_ids` string[] — Default node group ids, used in selected-node-groups mode
        - `node_ids` string[] — Default node ids, used in selected-nodes mode
        - `param` string — Default task param
        - `priority` integer — Priority
        - `project_id` string, objectid — Project ID
        - `template` string — Spider template
        - `template_params` ModelsSpiderTemplateParams — Spider template params
          - `allowed_domains` string — Allowed domains
          - `project_name` string — Project name
          - `spider_name` string — Spider name
          - `start_urls` string — Start urls
        - `updated_at` string, date-time — Updated timestamp
        - `updated_by` string, objectid — Updated by
      - `spider_id` string, objectid — Spider ID
      - `stat` ModelsTaskStat
        - `_id` string, objectid — ID
        - `created_at` string, date-time — Created timestamp
        - `created_by` string, objectid — Created by
        - `ended_at` string, date-time — End time
        - `result_count` integer — Result count
        - `runtime_duration` integer — Runtime duration (in millisecond)
        - `started_at` string, date-time — Start time
        - `total_duration` integer — Total duration (in millisecond)
        - `updated_at` string, date-time — Updated timestamp
        - `updated_by` string, objectid — Updated by
        - `wait_duration` integer — Wait duration (in millisecond)
      - `status` string — Status: pending, assigned, running, finished, error, cancelled, abnormal.
      - `updated_at` string, date-time — Updated timestamp
      - `updated_by` string, objectid — Updated by
    - `project` ModelsProject — The data to update
      - `_id` string, objectid — ID
      - `created_at` string, date-time — Created timestamp
      - `created_by` string, objectid — Created by
      - `description` string — Description
      - `name` string — Name
      - `updated_at` string, date-time — Updated timestamp
      - `updated_by` string, objectid — Updated by
    - `stat` ModelsSpiderStat
      - `_id` string, objectid — ID
      - `average_runtime_duration` integer
      - `average_total_duration` integer
      - `average_wait_duration` integer
      - `created_at` string, date-time — Created timestamp
      - `created_by` string, objectid — Created by
      - `last_task_id` string, objectid — Last task ID
      - `results` integer — Result count
      - `runtime_duration` integer — Runtime duration (in second)
      - `tasks` integer — Task count
      - `total_duration` integer — Total duration (in second)
      - `updated_at` string, date-time — Updated timestamp
      - `updated_by` string, objectid — Updated by
      - `wait_duration` integer — Wait duration (in second)
  - `error` string
  - `message` string
  - `status` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.net/crawlab-team/apis/crawlab-api.md) · [All operations](https://skmtc.net/crawlab-team/apis/crawlab-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crawlab-team/crawlab-api/versions/c7a4715c1f13/schema)
