info (allMids)
curl --request POST \
--url https://api.hyperliquid.xyz/info \
--header 'Content-Type: application/json' \
--data '
{
"type": "allMids",
"dex": ""
}
'import requests
url = "https://api.hyperliquid.xyz/info"
payload = {
"type": "allMids",
"dex": ""
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({type: 'allMids', dex: ''})
};
fetch('https://api.hyperliquid.xyz/info', 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.hyperliquid.xyz/info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'allMids',
'dex' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hyperliquid.xyz/info"
payload := strings.NewReader("{\n \"type\": \"allMids\",\n \"dex\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hyperliquid.xyz/info")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"allMids\",\n \"dex\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperliquid.xyz/info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"allMids\",\n \"dex\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"@142": "116849.5",
"BTC": "116845.5",
"ETH": "3915.35",
"HYPE": "40.7915"
}Hyperliquid node API
allMids | Hyperliquid info
Retrieves mid prices for all available coins on the Hyperliquid exchange. If the order book is empty, the last trade price is used as a fallback.
POST
/
info
info (allMids)
curl --request POST \
--url https://api.hyperliquid.xyz/info \
--header 'Content-Type: application/json' \
--data '
{
"type": "allMids",
"dex": ""
}
'import requests
url = "https://api.hyperliquid.xyz/info"
payload = {
"type": "allMids",
"dex": ""
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({type: 'allMids', dex: ''})
};
fetch('https://api.hyperliquid.xyz/info', 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.hyperliquid.xyz/info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'allMids',
'dex' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hyperliquid.xyz/info"
payload := strings.NewReader("{\n \"type\": \"allMids\",\n \"dex\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hyperliquid.xyz/info")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"allMids\",\n \"dex\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperliquid.xyz/info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"allMids\",\n \"dex\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"@142": "116849.5",
"BTC": "116845.5",
"ETH": "3915.35",
"HYPE": "40.7915"
}You can only use this endpoint on the official Hyperliquid public API. It is not available through Chainstack, as the open-source node implementation does not support it yet. See Hyperliquid methods for the full availability breakdown.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
type(string, required) — Must be"allMids"dex(string, optional) — Perp dex name. Defaults to empty string (first perp dex). Spot mids are only included with the first perp dex
Returns
Returns an object with coin symbols as keys and mid prices as string values.Mid price = (best bid + best ask) ÷ 2. When the order book is empty, the last trade price is used as fallback.
The response may also include internal index keys like
"@142" alongside human‑readable symbols (for example, "BTC", "ETH"). Use symbol keys for application logic and ignore "@..." keys if not needed.Example request
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"type": "allMids",
"dex": ""
}' \
https://api.hyperliquid.xyz/info
from hyperliquid.info import Info
from hyperliquid.utils import constants
# allMids is a public-only method — use the official Hyperliquid API URL.
info = Info(constants.MAINNET_API_URL, skip_ws=True)
# Posts {"type": "allMids", "dex": ""} to /info
mids = info.all_mids()
print(mids)
import { HttpTransport, InfoClient } from "@nktkas/hyperliquid";
// allMids is a public-only method — the default transport targets the official Hyperliquid API.
const transport = new HttpTransport();
const info = new InfoClient({ transport });
// Posts {"type": "allMids"} to /info
const mids = await info.allMids();
console.log(mids);
Use cases
- Price discovery — Get current market prices for all available assets
- Portfolio valuation — Calculate total portfolio value using current prices
- Trading interfaces — Display real-time prices in dashboards
- Market monitoring — Track price movements across all markets
Body
application/json
Response
200 - application/json
Mid prices for all available coins
Object containing mid prices for all coins with coin symbols as keys and prices as values
Mid price for the coin as a string
Last modified on June 24, 2026
Was this page helpful?