token_idstringobligatoire
The token ID to look up the parent market for
https://api.sandbase.ai/v1/api/polymarket/markets-by-tokenGet market by token from Polymarket. Returns the official Polymarket API response unchanged.
Votre sortie apparaîtra ici
Complétez les entrées, puis cliquez sur Exécuter.
Returns the parent market identifiers for a Polymarket outcome token. You send one token_id and get back the market's condition_id and the token IDs of both outcomes.
condition_id.condition_id needed to call market-level APIs from a list of token IDs.curl -X POST "https://api.sandbase.ai/v1/api/polymarket/markets-by-token" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"token_id": "32338220190071351435772801779725302244575775216413325951443816017994629993401"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
token_id | string | Yes | The token ID to look up the parent market for |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"condition_id": "0xa467b14d51f01b957109d9cbb1d6c124fab2a089d52ed8f471d23c2812e743b7",
"primary_token_id": "25659310…",
"secondary_token_id": "32338220…"
}
| Field | Meaning |
|---|---|
condition_id | Identifier of the parent market. It is a hex string starting with 0x. |
primary_token_id | Token ID of the market's first outcome token. |
secondary_token_id | Token ID of the market's second outcome token. In the example it matches the requested token_id. |
token_id. Token IDs are long numeric strings, so send them as strings.condition_id with Polymarket Get CLOB market info to get more detail on the market.$0.00044 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Commencer à construire
Point de terminaison de l'API de la plateforme avec authentification unifiée et suivi de l'utilisation.
curl -X POST "https://api.sandbase.ai/v1/api/polymarket/markets-by-token" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"token_id": "32338220190071351435772801779725302244575775216413325951443816017994629993401"
}'Définissez votre clé API SandBase dans l'environnement de votre serveur. Les requêtes utilisent l'authentification Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conservez votre clé côté serveur. Ne l'exposez pas dans le code du navigateur.
token_idstringobligatoireThe token ID to look up the parent market for
Exemple de réponse enregistré pour cette API ; aucune requête en direct n'est effectuée lors de l'affichage.
Aucune réponse enregistrée n'a été publiée. Exécutez l'API dans Playground pour inspecter sa réponse.
Explorer plus
| API | Prix | Réponse |
|---|---|---|
Polymarket Get market by tokenCette API Polymarket | $0.00044 par appel | JSON |
Polymarket | $0.012 par appel | JSON |
Polymarket | $0.012 par appel | JSON |
Polymarket | $0.012 par appel | JSON |
Polymarket | $0.012 par appel | JSON |
Polymarket | $0.012 par appel | JSON |
Questions
Envoyez une requête POST à https://api.sandbase.ai/v1/api/polymarket/markets-by-token avec votre clé API SandBase dans l’en-tête Authorization (Bearer) et les paramètres dans un corps JSON. Vous pouvez aussi l’essayer dans le Playground sur cette page sans écrire de code.
$0.00044 par appel, facturé depuis votre solde SandBase. Vous ne payez que les appels que vous effectuez ; aucun abonnement.
Obligatoire : token_id (string). Le tableau des paramètres et le Playground sur cette page listent tous les champs.
Une réponse JSON renvoyée dans la même requête HTTP (synchrone). Le README sur cette page inclut un exemple de réponse.
Non. Polymarket Get market by token fonctionne via SandBase, donc une seule clé API SandBase couvre ce point de terminaison ainsi que toutes les autres API et tous les modèles du catalogue. Vous n’avez pas besoin de demander un accès API Polymarket séparément.