Skip to main content
Complete JSON schema for spider configuration.

Root Schema

name
string
required
Spider identifier (alphanumeric, underscores, hyphens only)Validation:
  • Min length: 1
  • Max length: 255
  • Pattern: ^[a-zA-Z0-9_-]+$
Example: "bbc_co_uk", "example_shop"
source_url
string
required
Original website URLValidation:
  • Must use http:// or https:// scheme
  • Max length: 2048 characters
  • No localhost or private IPs (SSRF protection)
Example: "https://www.bbc.co.uk/"
allowed_domains
string[]
required
List of domains the spider can crawlValidation:
  • Min items: 1
  • Valid domain format
  • No localhost or private domains
Example:
start_urls
string[]
required
Initial URLs to crawl fromValidation:
  • Min items: 1
  • Must use HTTP/HTTPS
  • No localhost or private IPs
  • Max 2048 chars per URL
Example:
rules
SpiderRuleSchema[]
default:"[]"
URL matching and routing rulesSee Spider Rules for detailed schema.Example:
settings
SpiderSettingsSchema
default:"{}"
Spider configuration settingsSee Spider Settings for all available options.Example:
callbacks
object
default:"null"
Named callback extraction configurationsKeys must be valid Python identifiers. See Callbacks for schema.Reserved names (cannot use):
  • parse_article
  • parse_start_url
  • start_requests
  • from_crawler
  • closed
  • parse
Example:

Complete Example

News Site (BBC)

E-commerce Site

Validation Rules

Rule callbacks must be defined:
  • If a rule references a callback name, that callback must exist in the callbacks object
  • Built-in callback parse_article is always available
  • Use "callback": null for navigation-only rules
SSRF Protection:
  • URLs cannot point to localhost or private IP ranges
  • DNS resolution checked for private IPs
Injection Prevention:
  • Spider names: alphanumeric + underscore/hyphen only
  • Callback names must be valid Python identifiers
  • Reserved names blocked

Import Command

Validation errors will be displayed with specific field paths and error messages.