Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl --request GET \
--url https://swap-api.flux.fun/v1/prediction-market/markets \
--header 'x-api-key: <api-key>'import requests
url = "https://swap-api.flux.fun/v1/prediction-market/markets"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://swap-api.flux.fun/v1/prediction-market/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://swap-api.flux.fun/v1/prediction-market/markets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://swap-api.flux.fun/v1/prediction-market/markets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://swap-api.flux.fun/v1/prediction-market/markets")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://swap-api.flux.fun/v1/prediction-market/markets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"markets": [
{
"ticker": "KXBTC-24DEC31-T100K",
"eventTicker": "KXBTC-24DEC31",
"title": "Will Bitcoin reach $100,000 by Dec 31?",
"subtitle": "Bitcoin price prediction market",
"status": "open",
"marketType": "binary",
"yesBid": 45,
"yesAsk": 47,
"noBid": 53,
"noAsk": 55,
"lastPrice": 46,
"yesBidDollars": "0.45",
"yesAskDollars": "0.47",
"noBidDollars": "0.53",
"noAskDollars": "0.55",
"lastPriceDollars": "0.46",
"liquidity": 50000,
"liquidityDollars": "500.00",
"volume": 1000000,
"volume24h": 50000,
"openInterest": 25000,
"openTime": "2024-01-01T00:00:00Z",
"closeTime": "2024-12-31T23:59:59Z",
"expirationTime": "2025-01-01T12:00:00Z",
"rulesPrimary": "This market resolves to Yes if Bitcoin trades at or above $100,000",
"rulesSecondary": "<string>",
"yesSubTitle": "Bitcoin reaches $100K",
"noSubTitle": "Bitcoin stays below $100K",
"iconUrlDarkMode": "example.com/icon.png",
"iconUrlLightMode": "example.com/icon.png",
"backgroundColorLightMode": "#AA00FF",
"backgroundColorDarkMode": "#D24DFF"
}
],
"count": 20,
"cursor": "<string>"
}Retrieve a list of prediction markets with their current prices, liquidity, and market data. Supports pagination and filtering by status and event ticker.
curl --request GET \
--url https://swap-api.flux.fun/v1/prediction-market/markets \
--header 'x-api-key: <api-key>'import requests
url = "https://swap-api.flux.fun/v1/prediction-market/markets"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://swap-api.flux.fun/v1/prediction-market/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://swap-api.flux.fun/v1/prediction-market/markets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://swap-api.flux.fun/v1/prediction-market/markets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://swap-api.flux.fun/v1/prediction-market/markets")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://swap-api.flux.fun/v1/prediction-market/markets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"markets": [
{
"ticker": "KXBTC-24DEC31-T100K",
"eventTicker": "KXBTC-24DEC31",
"title": "Will Bitcoin reach $100,000 by Dec 31?",
"subtitle": "Bitcoin price prediction market",
"status": "open",
"marketType": "binary",
"yesBid": 45,
"yesAsk": 47,
"noBid": 53,
"noAsk": 55,
"lastPrice": 46,
"yesBidDollars": "0.45",
"yesAskDollars": "0.47",
"noBidDollars": "0.53",
"noAskDollars": "0.55",
"lastPriceDollars": "0.46",
"liquidity": 50000,
"liquidityDollars": "500.00",
"volume": 1000000,
"volume24h": 50000,
"openInterest": 25000,
"openTime": "2024-01-01T00:00:00Z",
"closeTime": "2024-12-31T23:59:59Z",
"expirationTime": "2025-01-01T12:00:00Z",
"rulesPrimary": "This market resolves to Yes if Bitcoin trades at or above $100,000",
"rulesSecondary": "<string>",
"yesSubTitle": "Bitcoin reaches $100K",
"noSubTitle": "Bitcoin stays below $100K",
"iconUrlDarkMode": "example.com/icon.png",
"iconUrlLightMode": "example.com/icon.png",
"backgroundColorLightMode": "#AA00FF",
"backgroundColorDarkMode": "#D24DFF"
}
],
"count": 20,
"cursor": "<string>"
}Maximum number of markets to return. Defaults to 20. Maximum is 1000.
Market status filter. Options: unopened, open, paused, closed, settled. Defaults to "open".
Pagination cursor for fetching the next page of results.
Filter by event ticker. Multiple event tickers can be provided as a comma-separated list (maximum 10).
Filter by specific market tickers. Comma-separated list of market tickers to retrieve.
