Getting started
If you'd rather wire DataGlass into your own script, notebook, or custom agent — instead of the one-click ChatGPT or Claude connectors — you can issue an API key and call the DataGlass REST API directly. An API key (also called a Personal Access Token) carries the same access your account has, but read-only.
Create a key
- Open the account menu (top-right) and go to Settings → API keys.
- Click Create API key.
- Give it a label you'll recognize later (e.g. "Profit script" or "Claude Desktop") and, optionally, an expiry — Never, 30, 60, 90, or 365 days.
- Copy the token that appears. It starts with
dg_pat_.
Call the API
Send the token as a Bearer token on the Authorization header. The API lives at https://prod-api.dataglasslabs.com.
# List your connected Shopee shops
curl https://prod-api.dataglasslabs.com/api/shopee/fetch-all-user-shops \
-H "Authorization: Bearer dg_pat_your_token_here"
Most endpoints are POST and take a JSON body — send Content-Type: application/json:
# Free-text product search
curl -X POST https://prod-api.dataglasslabs.com/api/canonical-product-controller/canonical/search-products \
-H "Authorization: Bearer dg_pat_your_token_here" \
-H "Content-Type: application/json" \
-d '{ "query": "phone case" }'
Every request runs as you — it sees exactly the shops, products, orders, and reports your account can see, and nothing from anyone else's.
What you can reach
API keys can call the read side of DataGlass: your products and unified catalog, orders, financial breakdowns, True ROAS, inventory, and the same recommendations that power your Actions. A key you create here has no scope picker, so it is read-only by construction. The ChatGPT and Claude connectors read the same data, but an assistant can additionally request per-domain write scopes that you approve at connect time — see Permissions and safety.
agent spec is generated internally from the live access rules — so it can never list an endpoint a key would be denied — but it is not currently served to the public internet. The endpoint references below are the authoritative public list.This documentation groups the same endpoints into four references:
- Products & orders — your catalog, unified products, orders, inventory, and connected shops
- Financial breakdown — true-profit breakdowns, profit-adjusted ROAS, margin tools, and shop overviews
- Raw platform data — normalized per-platform product, order, and ad-campaign records
- Actions & recommendations — the profit-improving Actions the engine generates
Conventions
A few things that apply to every endpoint:
- Base URL —
https://prod-api.dataglasslabs.com. All documented paths are relative to it. - Auth — send your key as
Authorization: Bearer dg_pat_…on every request. - Response envelope — responses are wrapped as
{ "status": "SUCCESS", "statusCode": 200, "message": …, "data": <result> }. The Response type shown for each endpoint is the shape ofdata. - Dates —
date-typed fields that carry a time component are serialized as arrays:[year, month (1-based), day, hour, minute, second]. region— marketplace region code (e.g.TH).shopId/sellerId— the platform identifiers returned by the shops endpoints in Products & orders.- Pagination — cursor-paginated endpoints return
{ rows/data, nextCursor }; passnextCursorback to fetch the next page. Offset-paginated (v3) endpoints takepage(0-based) +pageSizeand returntotalItems/totalPages. - Rate limit — 60 requests/minute per key; see API security & limits.
Manage and revoke
Back on Settings → API keys you'll see every key with its label, prefix, last-used date, expiry, and status. Click Revoke on any key to disable it immediately and permanently — do this the moment a token might be exposed.