Skip to content
pokemontcgapi.com

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/free

Cost and plans

Cost
free, no key needed
Minimum plan
Any key, the trial included.
Key
None: this route answers without a key.
Cache-Control
no-store

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 requiredstring—The address to verify for this account.

Headers

Headers
NameTypeDefaultDescription
Idempotency-Key requiredstring—Generate 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

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