Get Quote
curl --request GET \
--url https://swap-api.flux.fun/v1/prediction-market/markets/{ticker}/quote \
--header 'x-api-key: <api-key>'import requests
url = "https://swap-api.flux.fun/v1/prediction-market/markets/{ticker}/quote"
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/{ticker}/quote', 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/{ticker}/quote",
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/{ticker}/quote"
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/{ticker}/quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://swap-api.flux.fun/v1/prediction-market/markets/{ticker}/quote")
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{
"fillable": true,
"contracts": 100,
"cost": 4500,
"costDollars": "45.00",
"fee": 150,
"feeDollars": "1.50"
}Prediction Markets & Portfolio
Get Quote
Get a price quote for buying or selling a specific number of contracts in a prediction market. Returns the total cost including fees.
GET
/
v1
/
prediction-market
/
markets
/
{ticker}
/
quote
Get Quote
curl --request GET \
--url https://swap-api.flux.fun/v1/prediction-market/markets/{ticker}/quote \
--header 'x-api-key: <api-key>'import requests
url = "https://swap-api.flux.fun/v1/prediction-market/markets/{ticker}/quote"
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/{ticker}/quote', 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/{ticker}/quote",
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/{ticker}/quote"
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/{ticker}/quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://swap-api.flux.fun/v1/prediction-market/markets/{ticker}/quote")
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{
"fillable": true,
"contracts": 100,
"cost": 4500,
"costDollars": "45.00",
"fee": 150,
"feeDollars": "1.50"
}Authorizations
Path Parameters
The market ticker symbol
Query Parameters
Whether to buy or sell (default: buy)
Available options:
buy, sell Number of contracts to quote
Which side of the market (yes or no)
Available options:
yes, no Response
200 - application/json
Whether the quote is fillable
Example:
true
Number of contracts
Example:
100
Cost in cents
Example:
4500
Cost in dollars
Example:
"45.00"
Fee in cents
Example:
150
Fee in dollars
Example:
"1.50"
⌘I
