Retrieving an Export Through the API
An endpoint serves the latest saved records using the configured schema. The request does not start a new website collection. Use it to integrate a store, accounting system, or your own application.
Connecting
- Open the export and go to Getting data.
- Select the HTTP endpoint and the required format: JSON, XML, or CSV.
- Copy the address. Create an access token for this export and store it on the recipient's server. Its value is shown only once.
- Send a request with an
Authorization: Bearer ...header. - Check the first page and configure cursor pagination.
curl --fail-with-body \
-H "Authorization: Bearer $EXPORT_TOKEN" \
'https://YOUR_HOST/api/export/SITE_CODE/EXPORT_CODE.json?limit=100'
Replace YOUR_HOST, SITE_CODE, and EXPORT_CODE with your installation's values. localhost is available only on the computer making the request. An external recipient needs a reachable HTTPS address for the platform.
Data pages
By default, JSON contains data and metadata. Use envelope=0 for a simpler response if it suits the recipient. Continuation is given by cursor and has_more, as well as the X-Export-Cursor and X-Export-Has-More headers. X-Export-Count reports the number of records in the response.
Pass the returned cursor as after in the next request. Store a cursor only after the entire page has been processed successfully. limit ranges from 1 to 10,000 and defaults to 1,000. Metadata is available at the address without an extension, ending in /meta. Do not confuse this cursor scheme with page on management API lists.
Updates and deletions
Update a product by a stable identifier or product code. Its absence from one page does not mean deletion. To synchronize deletions, include deleted records and the _deleted field. After changing the schema or filters, restart synchronization without the old cursor.
Access and errors
An export token can be restricted by sites, profiles, formats, expiry, rate, and, if configured, IP addresses. Check its permissions after changing the format. Do not put the key in a URL, where it may enter browser history and logs.
401: invalid token; 403: access denied; 402: billing restriction; 422: parameters or processing; 429: too many requests. Preparing the response consumes processing time. See limits.
This token cannot create sites or scenarios. To manage resources, use a separate API key.