curl --request GET \
--url https://api.aries.com/v1/predictions/searchimport requests
url = "https://api.aries.com/v1/predictions/search"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.aries.com/v1/predictions/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aries.com/v1/predictions/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aries.com/v1/predictions/search"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aries.com/v1/predictions/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aries.com/v1/predictions/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"type": "contracts",
"hits": [
{
"symbol": "UNR_0822_3.5",
"eventId": "<string>",
"baseEventId": "<string>",
"symbolSubTypes": [
"<string>"
],
"state": "ACTIVE",
"tradable": true,
"tickSize": "0.01",
"question": "<string>",
"strikeValue": "<string>",
"evaluationType": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"lastTradeDate": "2023-11-07T05:31:56Z",
"expirationDate": "2023-11-07T05:31:56Z",
"eventDisplayName": "<string>",
"eventQuestion": "<string>",
"timeSpecifier": "2022.08",
"underlyingSpec": "<string>"
}
],
"found": 1,
"page": 2,
"perPage": 50
}
}{
"success": false,
"error": {
"type": "VALIDATION",
"code": "SYMBOL_REQUIRED",
"message": "string"
}
}{
"success": false,
"error": {
"type": "EXTERNAL_SERVICE",
"code": "UPSTREAM_UNAVAILABLE",
"message": "string"
}
}Search Prediction Market
Full-text search over prediction-market contracts, returning hits as contracts, events, or base events. Filters always apply at the contract level.
Use Case: Discover symbols, event IDs, and base event IDs before pulling reference data or historical ticks.
curl --request GET \
--url https://api.aries.com/v1/predictions/searchimport requests
url = "https://api.aries.com/v1/predictions/search"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.aries.com/v1/predictions/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aries.com/v1/predictions/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aries.com/v1/predictions/search"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aries.com/v1/predictions/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aries.com/v1/predictions/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"type": "contracts",
"hits": [
{
"symbol": "UNR_0822_3.5",
"eventId": "<string>",
"baseEventId": "<string>",
"symbolSubTypes": [
"<string>"
],
"state": "ACTIVE",
"tradable": true,
"tickSize": "0.01",
"question": "<string>",
"strikeValue": "<string>",
"evaluationType": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"lastTradeDate": "2023-11-07T05:31:56Z",
"expirationDate": "2023-11-07T05:31:56Z",
"eventDisplayName": "<string>",
"eventQuestion": "<string>",
"timeSpecifier": "2022.08",
"underlyingSpec": "<string>"
}
],
"found": 1,
"page": 2,
"perPage": 50
}
}{
"success": false,
"error": {
"type": "VALIDATION",
"code": "SYMBOL_REQUIRED",
"message": "string"
}
}{
"success": false,
"error": {
"type": "EXTERNAL_SERVICE",
"code": "UPSTREAM_UNAVAILABLE",
"message": "string"
}
}Overview
Search runs over a single index of event contracts. Thetype parameter picks the level hits come back at, and the response echoes it in data.type so a client can branch on the shape it actually received.
type | Hit shape | Notes |
|---|---|---|
contracts (default) | One hit per matching contract | Each hit carries its event’s and base event’s text flattened in. |
events | One hit per event | Ranked by its best-matching contract, carrying up to contractsPerHit of them. |
base-events | One hit per base event | Same, one level up. The index carries no display name — read it from Get Base Event. |
Filters apply to contracts
This matters whentype is events or base-events: an event or base event is only found through its matching contracts. One whose contracts are all filtered out — for example an event holding only DELETED contracts under the default state — is not returned at all, even if its own text matches the query.
found, page, and perPage count whatever type returns, not the underlying contracts. contractsFound on each hit is the count of every matching contract under it, which can exceed the number of contracts attached to the hit.
Query syntax
q searches symbols, contract questions, event names, and base-event specifications. Symbols are split on _, -, and ., so a partial query finds the full symbol:
GET /v1/predictions/search?q=BPM 0822 → matches BPM_0822_1750
GET /v1/predictions/search?q=unemployment june
q entirely to browse the catalogue, ordered by soonest last-trade date first.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
type | string | contracts | contracts, events, or base-events. Echoed in data.type. |
q | string | — | Full-text query. Omit to browse. |
state | string | ACTIVE | Contract state. Use * to match every state, including DELETED. |
baseEventId | string | — | Restrict to contracts under this base event. |
eventId | string | — | Restrict to contracts under this event. |
tradable | boolean | — | Restrict to tradable (true) or non-tradable (false) contracts. |
page | integer | 1 | 1-based page number. 0 or omitted means 1. |
perPage | integer | 20 | Hits per page. 0 or omitted means 20; values above 100 are clamped to 100. |
contractsPerHit | integer | 3 | Contracts attached to each events / base-events hit. 0 or omitted means 3; values above 99 are clamped to 99. Ignored when type=contracts. |
Search results trail the catalogue
The index is updated from the catalogue and lags it by seconds. Treat a hit’ssymbol as the key into Get Event Contracts and read anything that must be current — state, tradable — from there. Do not act on a hit’s own tradable field.
Response
{
"success": true,
"data": {
"type": "events",
"found": 12,
"page": 1,
"perPage": 20,
"hits": [
{
"eventId": "UNR_0822",
"baseEventId": "UNR",
"eventQuestion": "What will the June unemployment rate be?",
"timeSpecifier": "2022.08",
"contractsFound": 7,
"contracts": [
{
"symbol": "UNR_0822_3.5",
"eventId": "UNR_0822",
"baseEventId": "UNR",
"state": "ACTIVE",
"tradable": true,
"tickSize": "0.01",
"symbolSubTypes": []
}
]
}
]
}
}
Examples
Find contracts by text
curl -X GET "https://api.aries.com/v1/predictions/search?q=unemployment%20june"
Group hits by event, with more contracts each
curl -X GET "https://api.aries.com/v1/predictions/search?type=events&q=unemployment&contractsPerHit=10"
Browse a single base event, tradable only
curl -X GET "https://api.aries.com/v1/predictions/search?baseEventId=UNR&tradable=true&perPage=50"
Include deleted contracts
curl -X GET "https://api.aries.com/v1/predictions/search?q=unemployment&state=*"
Errors
400— an unknowntype, or a parameter that failed validation502— the search index was unavailable
Query Parameters
Level hits come back at. contracts (default) returns matching contracts; events returns one hit per event and base-events one per base event, each ranked by its best-matching contract and carrying up to contractsPerHit of them. Echoed in the response.
contracts, events, base-events Full-text query over symbols, questions, event names and base-event specifications. Symbols split on _, - and . so BPM 0822 finds BPM_0822_1750. Omit to browse, soonest last-trade date first.
"unemployment june"
Contract state. Omitted means ACTIVE; * matches every state, including DELETED.
"ACTIVE"
Only contracts under this base event.
"UNR"
Only contracts under this event.
"UNR_0822"
Only tradable (true) or non-tradable (false) contracts.
1-based page number; 0 or omitted means 1.
x >= 01
Hits per page, counting whatever type returns; 0 or omitted means 20, values above 100 are clamped to 100.
0 <= x <= 10020
With type=events or type=base-events: matching contracts attached to each hit; 0 or omitted means 3, values above 99 are clamped to 99. Ignored for contracts.
0 <= x <= 993
Was this page helpful?