/apibackuper:apibackuperfrom apibackuper
Pulls all records from paginated HTTP APIs (JSON, XML, HTML) into a resumable local archive, exporting to JSONL or Parquet via YAML config. Replaces hand-written scraper/ETL loops for API data collection.
Ships in apibackuper. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
apibackuper is a CLI that pages through an HTTP API, saves every response,
resumes after failures, records provenance and exports records. A project is a
directory with apibackuper.yaml and optional request files. Pagination,
retries, rate limits, authentication, resume, incremental updates and export
are configuration, not code.
Prefer it over writing a collector. The only code you should write is a small hook or extraction function for what the configuration cannot express, or a post-processing step over the exported JSONL.
| The source | Use apibackuper? |
|---|---|
List/search endpoint returning records page by page (page number, offset, numeric range, cursor token, next URL, Link header) | Yes |
| GET with query parameters, or POST with a JSON body | Yes |
| JSON or XML responses | Yes |
| Server-rendered HTML listing paged through the URL | Yes, with resp_type: html and a code.postfetch extractor |
| Basic, Bearer, API key header, OAuth2 (refresh token or client credentials) | Yes |
| Detail endpoint per record, or attached files to download | Yes, follow rules and getfiles |
| Pages rendered by JavaScript, browser login, CAPTCHA | No: use a browser tool |
| One request or a few fixed URLs | No: use curl |
| Iteration only by date windows, no page/offset/cursor | Not natively: one project per window, or a before_request hook |
| Form-encoded POST bodies | No: POST bodies are JSON only |
Install if apibackuper --help fails: pipx install apibackuper or
pip install apibackuper (Python 3.10+). If apibackuper init --help fails,
the installed version is older than 3.1: pipx upgrade apibackuper or
pip install --upgrade apibackuper. Add apibackuper[recommended] for
Parquet and WARC export.
Put --json before any command to get exactly one JSON object on stdout
({"ok": true, "result": ...} or {"ok": false, "error": {"code", "message", "hints"}}); other output goes to stderr and progress bars are off.
Create the project from the endpoint.
apibackuper --json init myproject --url "https://api.example.com/items"
init sends one request plus a few probes (page=2, per_page=100, ...)
and writes a complete apibackuper.yaml. Its report lists the detected
settings, the record fields, a sample_record, warnings and
next_steps. Options: --method POST --body '{"q": "*"}',
-H "Accept: application/json" (repeatable), --auth bearer|apikey|basic
with --auth-env VAR (secrets stay ${VAR} placeholders; export the
variable first so the endpoint can be probed), --data-key to override the
records path. Query parameters in the URL move into params.json.
Read the warnings. If pagination was not detected, open the API docs or
request page 2 with curl, then set the names by hand from
references/config-patterns.md. Do not use
apibackuper create: it writes a legacy INI file and ignores its --url
and --datakey options.
Validate offline.
cd myproject
apibackuper validate-config --strict --json
Each error and warning has a path, message and hint. A warning about a
missing pagination parameter means a run would save only the first page.
apibackuper schema prints every allowed field.
Check two pages of real data.
apibackuper --json run full --max-pages 2
This sample run uses a temporary archive and leaves the project untouched.
Check records, total_reported, more_pages, fields and preview.
It fails with error code pagination_ignored when page 2 repeats page 1 and
with backup_incomplete when the API caps the page size below
page_size_limit. Fix the YAML and repeat until it passes.
Collect.
apibackuper --json run full
A nonzero exit means the backup is incomplete and the previous archive is
kept. Fix the cause, then continue with apibackuper run full --resume.
Export and check.
apibackuper export items.jsonl
apibackuper --json info
apibackuper --json verify
Compare result.statistics.storage.total_records from info with the API
total. Use --fields id,title and --where "id >= 3" on export to select
data, and .jsonl.gz, .jsonl.zst or .parquet file names for other formats.
Hand over. Give the user the project directory, the commands to rerun
(apibackuper update for new or changed records, see the patterns file), and
the export path.
Run commands inside the project directory, or pass -p PATH to each command.
apibackuper detect --url URL prints the same detection as YAML without
creating a directory.
settings:
name: items
project:
url: https://api.example.com/items
http_mode: GET
iterate_by: page
params:
page_number_param: page
page_size_param: per_page
page_size_limit: 100
data:
data_key: items
total_number_key: total
item_key: id
storage:
storage_type: zip
| API contract | Settings |
|---|---|
?page=2&per_page=100 | iterate_by: page, page_number_param, page_size_param |
?offset=200&limit=100 | iterate_by: skip, count_skip_param, page_size_param |
?from=200&to=300 (exclusive end) | iterate_by: range, count_from_param, count_to_param |
| Token in response, sent back as a parameter | iterate_by: cursor, params.cursor_param, data.next_cursor_key |
| Next page URL in the body | iterate_by: next_url, data.next_url_key |
Link: <...>; rel="next" header | iterate_by: link_header |
Records at result.items | data.data_key: result.items (dot path) |
| Response is a bare list | omit data_key |
Total record count at meta.total | data.total_number_key: meta.total |
| Total page count instead | data.pages_number_key |
params.json beside the YAML.
Headers: headers.json. These JSON files do not expand ${VAR}.auth section with "${VAR}" placeholders in YAML. Never put a
literal token in a file you hand back.hooks.before_request script with
hook(context) returning {"params": ...} or {"headers": ...}.project.resp_type: html and
code.postfetch: /abs/path/extract.py with process(content) returning a
list of records.follow rules, then apibackuper follow full.files section, then apibackuper getfiles.request.response_rules.from apibackuper.cmds.project import ProjectBuilder.Exact YAML for each case: references/config-patterns.md. Errors and fixes: references/troubleshooting.md.
params.page_size_limit must equal the number of records the API really
returns on a full page. init and detect probe it; when you set it by
hand, a larger value makes the run fail with "returned N records ... before
page M".params section holds parameter names; values go into params.json.total_number_key is a record count; pages_number_key is a page count.apibackuper schema rather than guessing.update runs a record can appear more
than once. Deduplicate downstream by item_key if the user needs a snapshot.--verbose writes debug logs to apibackuper.log in the working directory.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
api-scraper, data-collection, etl-extract, pagination, data-archive
npx claudepluginhub ruarxive/apibackuper --plugin apibackuperOther plugins' skills for the same job