Skip to content
pokemontcgapi.com
Documentation

Create a key for a script

For scripts only. Creates a key without a password, so this account cannot sign in to the dashboard until the email is verified and a password is set from /account/recover; a person wanting the dashboard should use /free-api-key (POST /v1/accounts/register) instead.

POST/v1/accounts/freefree, no key neededfree plan

Cache-Control: no-store

No key yet? One call gets you one: POST /v1/accounts/free with an Idempotency-Key header and your email address returns a working key in the response. Keep the original Idempotency-Key and body for response replay for up to 24 hours, under the conditions in the quickstart. The trial is 800 credits over 30 days once the address is confirmed, no card; paid plans start at 29 € a month. See the quickstart and the pricing.

For scripts only. Creates a key without a password, so this account cannot sign in to the dashboard until the email is verified and a password is set from /account/recover; a person wanting the dashboard should use /free-api-key (POST /v1/accounts/register) instead.

For dashboard access, create an account in the browser. For script setup and the full replay conditions, follow the quickstart.

Save data.key.secret. If the response is lost, replay the same Idempotency-Key and body from the same network within 24 hours, under the quickstart conditions. The response excerpt below shows only the key secret; other account, key and quota fields are omitted.

Body fields

Body fields
NameTypeDefaultDescription
email requiredstringThe address to verify for this account.

Headers

Headers
NameTypeDefaultDescription
Idempotency-Key requiredstringGenerate once per signup and keep it with the exact request body for retries.

Example request

IDEM=$(uuidgen)
curl -s -X POST "https://api.pokemontcgapi.com/v1/accounts/free" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEM" \
  -d '{"email":"[email protected]"}'

Example response

201 OK · Cache-Control: no-store

response.json
{"data":{"key":{"secret":"ptcg_live_example"}}}

Errors

Every error body carries error.code, error.message and error.request_id. Switch on the code, never on the message.

Errors returned by this endpoint
StatusCodeWhen
400INVALID_PARAMETERA query parameter has the wrong type or an unsupported value — a non-integer limit, an unknown lang, an unknown region, a sort key that is not sortable.

The full taxonomy, with what to do about each code, is on the errors page.

A new signup for the same email returns 409 ACCOUNT_EXISTS. Reusing an Idempotency-Key with a different body returns 409 IDEMPOTENCY_CONFLICT.

view this page as markdown