Skip to main content

Base URL

All Struct API requests are made to:
https://api.struct.to
Enterprise customers with a dedicated domain can use their own host. See SDK Configuration for the override.

Authentication

Every request must include your API key in the X-API-Key header.
curl https://api.struct.to/v1/polymarket/market \
  -H "X-API-Key: YOUR_API_KEY"
See Authentication for secret keys, JWT public keys (browser-safe), rotation, and the full error responses.
Keep sk_live_* keys secret. Never embed them in client-side code, mobile apps, or public repositories. Use pk_jwt_* keys for any environment you do not fully control.

Making your first request

1

Create an account

Sign up at struct.to/dashboard and create an organisation.
2

Generate an API key

Open the API Keys page in your dashboard and create a new key. Copy the value somewhere safe; you won’t be able to view it again. See Authentication for key types, JWT public keys, and rotation.
3

Send a request

Use the base URL and your API key to make your first call:
import { StructClient } from "@structbuild/sdk";

const client = new StructClient({ apiKey: "YOUR_API_KEY" });

const { data: markets } = await client.markets.getMarkets({ limit: 10 });

Response format

Every response is wrapped in a standard envelope with success, data, message, and an info block carrying the API version and credits_consumed. See Response Format.

Rate limits

Limits depend on your plan. See Rate Limits for the full matrix and Pricing for credit allowances.

Errors

Failures return the same envelope with success: false. For the full status-code reference and retry guidance, see Errors.
Last modified on June 16, 2026