Full catalog download and change feed

Keep your own copy of the catalog instead of looking products up one at a time. The full download is on Pro and Scale. The change feed is on Scale. Each call is one request against the monthly allowance and no products against the daily cap.

Full download

GET /api/v1/catalog/download returns the whole catalog as of the last completed sync: gzipped JSON Lines, one product per line, in the same shape as a product lookup. You can fetch it 6 times an hour. After that you get a 429 with Retry-After.

The ETag names the file. Send it back in If-None-Match and an unchanged file answers 304 with no body. Three headers describe the file: X-Cardspine-Sync-Run, X-Cardspine-Product-Count and X-Cardspine-Change-Cursor. Keep the cursor. It is where the change feed picks up.

Download
curl "https://api.cardspine.com/api/v1/catalog/download" \
  -H "X-Api-Key: $CARDSPINE_KEY" \
  -H 'If-None-Match: "1234"' \
  -o catalog.jsonl.gz

Change feed

GET /api/v1/changes?after= lists what changed since a cursor, oldest first. Send the X-Cardspine-Change-Cursor of the download you hold as after. Each page returns a cursor to send as the next after, and hasMore says whether to ask again. A change names the entity, what happened to it and the fields that changed. Fetch the product for the new values.

Changes
curl -G "https://api.cardspine.com/api/v1/changes" \
  -H "X-Api-Key: $CARDSPINE_KEY" \
  --data-urlencode "after=48210"

Changes are kept for 30 days. If your cursor is older, the call answers 410. Download the full catalog again and resume from the X-Cardspine-Change-Cursor of that file.

Endpoint reference

Generated from the published OpenAPI document, Cardspine API v1. Paths are on https://api.cardspine.com. Download openapi.json

Catalog download

GET/api/v1/catalog/download

Downloads the whole catalog as of the last completed sync: gzipped JSON Lines, one product per line in the same shape as a product lookup. It counts as one request against the monthly allowance and no products. The ETag is the sync run id; send it back in If-None-Match to skip an unchanged file. X-Cardspine-Sync-Run, X-Cardspine-Change-Cursor and X-Cardspine-Product-Count describe the file.

Parameters

None. Send only your key.

Request
curl "https://api.cardspine.com/api/v1/catalog/download" \
  -H "X-Api-Key: $CARDSPINE_KEY"

Other responses

304
If-None-Match matches the current file.
403
The client's plan does not include the full download.
429
The client has used its downloads for the hour. Retry after the Retry-After interval.
503
No export has been written yet. Retry later.
401
As on every call; see Limits and errors.

Changes

GET/api/v1/changes

Reads the catalog changes recorded after a cursor, oldest first, so a copy made from the full download can be kept current. Start from the X-Cardspine-Change-Cursor of the download you hold, then send each page's cursor as after. It counts as one request against the monthly allowance and no products. Changes are kept for 30 days.

Parameters

afterquery · integer · optional
The cursor: only changes with a larger id are returned. 0 starts from the oldest change kept.
limitquery · integer · optional
Changes per page, 1 to 1,000. Defaults to 500.
Request
curl "https://api.cardspine.com/api/v1/changes" \
  -H "X-Api-Key: $CARDSPINE_KEY"

Returns 200 ChangeFeedPageV1

A page of catalog changes.

changesChangeV1[]
The changes on this page, oldest first.
7 fields of ChangeV1

One change to the catalog.

idinteger
The change's id. Ids rise in the order changes were recorded; use the largest one you have seen as the cursor.
entityTypestring
What changed: product or set.
entityIdinteger
The TCGplayer product id of a product, or the TCGplayer group id of a set.
syncRunIdinteger
The sync run that recorded the change. It matches X-Cardspine-Sync-Run on a download made by that run.
changeTypestring
created, updated, marked_missing, removed or restored.
changedFieldsstring[]
For an update, the fields of the entity that may have changed, named as in the product and set responses. Empty for the other change types, and when only data we do not publish changed.
occurredAtstring (date-time)
When the change was recorded.
cursorinteger
Send this as after to read the next page. It is the id of the last change on the page, or the after you sent when the page is empty.
hasMoreboolean
True when later changes exist beyond this page.

Other responses

400
after or limit is out of range.
403
The client's plan does not include the change feed.
410
The cursor is older than the changes we keep. Download the full catalog again and resume from its X-Cardspine-Change-Cursor.
429
A request, product or monthly limit was exceeded. Retry after the interval in the Retry-After header.
401
As on every call; see Limits and errors.