Search prediction markets by query
curl --request GET \
--url https://swap-api.flux.fun/v1/prediction-market/search \
--header 'x-api-key: <api-key>'import requests
url = "https://swap-api.flux.fun/v1/prediction-market/search"
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/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://swap-api.flux.fun/v1/prediction-market/search",
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/search"
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/search")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://swap-api.flux.fun/v1/prediction-market/search")
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{
"total_results_count": 42,
"current_page": [
{
"series_ticker": "SERIES-BTC-2024",
"series_title": "Bitcoin Price Series 2024",
"event_ticker": "EVENT-BTC-2024",
"event_subtitle": "Bitcoin price prediction event",
"event_title": "Bitcoin Price Event 2024",
"category": "Science and Technology",
"total_series_volume": 1000000,
"total_volume": 500000,
"total_market_count": 10,
"active_market_count": 8,
"markets": [
{
"ticker": "KXBTC-24DEC31-T100K",
"yes_bid": 45,
"yes_ask": 47,
"last_price": 46,
"yes_bid_dollars": "0.45",
"yes_ask_dollars": "0.47",
"last_price_dollars": "0.46",
"price_delta": 1.5,
"close_ts": "2024-12-31T23:59:59Z",
"expected_expiration_ts": "2025-01-01T12:00:00Z",
"open_ts": "2024-01-01T00:00:00Z",
"score": 0.95,
"yes_subtitle": "<string>",
"no_subtitle": "<string>",
"title": "<string>",
"potential_payout_from_100_dollars": {},
"icon_url_dark_mode": "<string>",
"icon_url_light_mode": "<string>",
"background_color_light_mode": "<string>",
"background_color_dark_mode": "<string>"
}
]
}
],
"next_cursor": "<string>"
}Prediction Markets & Portfolio
Search prediction markets by query
GET
/
v1
/
prediction-market
/
search
Search prediction markets by query
curl --request GET \
--url https://swap-api.flux.fun/v1/prediction-market/search \
--header 'x-api-key: <api-key>'import requests
url = "https://swap-api.flux.fun/v1/prediction-market/search"
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/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://swap-api.flux.fun/v1/prediction-market/search",
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/search"
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/search")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://swap-api.flux.fun/v1/prediction-market/search")
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{
"total_results_count": 42,
"current_page": [
{
"series_ticker": "SERIES-BTC-2024",
"series_title": "Bitcoin Price Series 2024",
"event_ticker": "EVENT-BTC-2024",
"event_subtitle": "Bitcoin price prediction event",
"event_title": "Bitcoin Price Event 2024",
"category": "Science and Technology",
"total_series_volume": 1000000,
"total_volume": 500000,
"total_market_count": 10,
"active_market_count": 8,
"markets": [
{
"ticker": "KXBTC-24DEC31-T100K",
"yes_bid": 45,
"yes_ask": 47,
"last_price": 46,
"yes_bid_dollars": "0.45",
"yes_ask_dollars": "0.47",
"last_price_dollars": "0.46",
"price_delta": 1.5,
"close_ts": "2024-12-31T23:59:59Z",
"expected_expiration_ts": "2025-01-01T12:00:00Z",
"open_ts": "2024-01-01T00:00:00Z",
"score": 0.95,
"yes_subtitle": "<string>",
"no_subtitle": "<string>",
"title": "<string>",
"potential_payout_from_100_dollars": {},
"icon_url_dark_mode": "<string>",
"icon_url_light_mode": "<string>",
"background_color_light_mode": "<string>",
"background_color_dark_mode": "<string>"
}
]
}
],
"next_cursor": "<string>"
}Authorizations
Query Parameters
Search query
Example:
"bitcoin"
Results per page (default: 25)
Example:
25
Sort order (default: querymatch)
Example:
"trending"
Fuzzy search threshold (default: 4)
Example:
4
Include milestones (default: true)
Example:
true
Pagination cursor
Example:
"cursor123"
Market status filter
Available options:
open, unopened, closed, settled Category filter
Example:
"Science and Technology"
Frequency filter
Available options:
hourly, daily, weekly, monthly, annual ⌘I
