Skip to main content
Data commands allow you to inspect scraped items from test crawls and export them to various formats (CSV, JSON, JSONL, Parquet).

show

View scraped items from the database.

Syntax

Arguments

spider
string
required
Spider name.

Options

--project
string
required
Project name.
--limit, -l
integer
default:"5"
Number of items to display.
--url
string
Filter by URL pattern (case-insensitive substring match).
--title
string
Search in titles only (case-insensitive).
--text, -t
string
Search in both title and content (case-insensitive).

Examples

Output

Article Items (Generic Extractors)

Callback Items (Custom Extractors)

export

Export scraped items to file formats.

Syntax

Arguments

spider
string
required
Spider name.

Options

--project
string
required
Project name.
--format, -f
choice
required
Export format: csv, json, jsonl, parquet.
--output, -o
string
Custom output file path. If not specified, uses timestamped filename in data/<project>/<spider>/exports/.
--limit, -l
integer
Limit number of items to export.
--url
string
Filter by URL pattern.
--title
string
Filter by title.
--text, -t
string
Filter by title or content.

Examples

Output

Export Formats

CSV

JSON

Pretty-printed JSON array:

JSONL (JSON Lines)

Parquet

Requires pandas and pyarrow:

Default Export Location

Database Storage

scraped_items Table

Items are stored in this table during test crawls:

Standard vs. Custom Fields

Standard fields (from newspaper/trafilatura extractors):
  • Stored in dedicated columns: title, content, author, published_date
Custom fields (from callback extractors):
  • Stored in metadata_json column as JSON
  • Includes _callback key to identify which callback was used

Data Retention

Test Crawls: Data stored in database until spider is deleted (cascading delete). Production Crawls: Data exported to JSONL files in data/<project>/<spider>/crawls/ (not stored in database).

Troubleshooting

Spider Not Found: Verify project and spider name with ./scrapai spiders list --project <name> No Items Found: Run a test crawl first - production crawls save to JSONL files, not database Parquet Export Error: Install dependencies: .venv/bin/pip install pandas pyarrow

Next Steps

Database Commands

Advanced queries and database management

Inspection

Analyze websites before scraping