List markets
curl --request GET \
--url https://api.foresight.now/v1/marketsimport requests
url = "https://api.foresight.now/v1/markets"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.foresight.now/v1/markets', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.foresight.now/v1/markets")
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{
"data": [
{
"condition_id": "<string>",
"chain_id": 56,
"question": "Will BTC close above $100k on Dec 31?",
"tokens": [
{
"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
}
}
],
"next_cursor": "<string>",
"has_more": true
}{
"correlation_id": "<string>",
"code": "NOT_FOUND",
"message": "<string>",
"status_code": 404,
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/markets/0x.../book"
}Market Data
List markets
List CLOB markets on a chain. L0 — public. Paginated.
GET
/
v1
/
markets
List markets
curl --request GET \
--url https://api.foresight.now/v1/marketsimport requests
url = "https://api.foresight.now/v1/markets"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.foresight.now/v1/markets', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.foresight.now/v1/markets")
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{
"data": [
{
"condition_id": "<string>",
"chain_id": 56,
"question": "Will BTC close above $100k on Dec 31?",
"tokens": [
{
"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
}
}
],
"next_cursor": "<string>",
"has_more": true
}{
"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.
Available options:
en, cn Query Parameters
Blockchain network id. BSC mainnet is 56.
Example:
56
Filter by market status (case-insensitive). Defaults to open.
Available options:
open, closed, resolved, paused Opaque cursor from the prior response's next_cursor.
Required range:
1 <= x <= 100⌘I