curl --request GET \
--url https://api.foresight.now/v1/markets/{condition_id}import requests
url = "https://api.foresight.now/v1/markets/{condition_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.foresight.now/v1/markets/{condition_id}', 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.foresight.now/v1/markets/{condition_id}",
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.foresight.now/v1/markets/{condition_id}"
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.foresight.now/v1/markets/{condition_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.foresight.now/v1/markets/{condition_id}")
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{
"condition_id": "<string>",
"chain_id": 56,
"question": "Will BTC close above $100k on Dec 31?",
"status": "OPEN",
"tokens": [
{
"outcome": 0,
"outcome_label": "NO",
"token_id": "<string>",
"decimals": 18
}
],
"fee_rate_bps": 100,
"created_at": "2023-11-07T05:31:56Z",
"summary": "<string>",
"rules": "<string>",
"collateral_token": "<string>",
"ctf_exchange_address": "<string>",
"conditional_tokens_address": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"ticker": {
"bestBid": 0.54,
"bestAsk": 0.55,
"lastPrice": 0.545,
"spread": 0.01,
"displayPriceYES": 0.55,
"displayPriceNO": 0.45
}
}{
"correlation_id": "<string>",
"code": "NOT_FOUND",
"message": "<string>",
"status_code": 404,
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/markets/0x.../book"
}Get a market
Single-market detail by condition_id. Accepts any status. L0 — public.
curl --request GET \
--url https://api.foresight.now/v1/markets/{condition_id}import requests
url = "https://api.foresight.now/v1/markets/{condition_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.foresight.now/v1/markets/{condition_id}', 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.foresight.now/v1/markets/{condition_id}",
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.foresight.now/v1/markets/{condition_id}"
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.foresight.now/v1/markets/{condition_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.foresight.now/v1/markets/{condition_id}")
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{
"condition_id": "<string>",
"chain_id": 56,
"question": "Will BTC close above $100k on Dec 31?",
"status": "OPEN",
"tokens": [
{
"outcome": 0,
"outcome_label": "NO",
"token_id": "<string>",
"decimals": 18
}
],
"fee_rate_bps": 100,
"created_at": "2023-11-07T05:31:56Z",
"summary": "<string>",
"rules": "<string>",
"collateral_token": "<string>",
"ctf_exchange_address": "<string>",
"conditional_tokens_address": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"ticker": {
"bestBid": 0.54,
"bestAsk": 0.55,
"lastPrice": 0.545,
"spread": 0.01,
"displayPriceYES": 0.55,
"displayPriceNO": 0.45
}
}{
"correlation_id": "<string>",
"code": "NOT_FOUND",
"message": "<string>",
"status_code": 404,
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/markets/0x.../book"
}Headers
Language for translated fields (summary, rules). Defaults to English.
en, cn Path Parameters
On-chain ConditionalTokens condition hash.
"0x9cded060be358b76678e598084cf258c7257771e473dbb461cad23417302d606"
Query Parameters
Blockchain network id. BSC mainnet is 56.
56
Response
OK
On-chain ConditionalTokens condition hash.
56
"Will BTC close above $100k on Dec 31?"
Raw market status. Trading is only possible while OPEN.
OPEN, CLOSED, RESOLVED, PAUSED, SEEDING Show child attributes
Show child attributes
Advertised platform fee in basis points (100 = 1%).
100
Market-group description, translated per X-Language.
Resolution rules, translated per X-Language.
Collateral ERC-20 address.
CTF Exchange contract — used as the EIP-712 verifyingContract when signing orders for this market.
ConditionalTokens (ERC-1155) contract address for this market's chain.
Cached ticker snapshot as embedded in a market object. Numeric fields
are JSON numbers (camelCase). null until the first order/trade populates
the cache. Note: this differs from the standalone /ticker endpoint, which
returns snake_case string fields.
Show child attributes
Show child attributes