Get token pair connections
curl --request GET \
--url https://api.hypermid.io/v1/connections \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.hypermid.io/v1/connections"
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://api.hypermid.io/v1/connections', 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.hypermid.io/v1/connections",
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://api.hypermid.io/v1/connections"
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://api.hypermid.io/v1/connections")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hypermid.io/v1/connections")
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{
"data": {
"connections": [
{
"fromChainId": 1,
"toChainId": 42161,
"fromTokens": [
{
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH"
},
{
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"symbol": "USDC"
}
],
"toTokens": [
{
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH"
},
{
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"symbol": "USDC"
}
],
"tools": ["stargate", "hop", "across"]
}
]
},
"error": null,
"meta": {
"requestId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"timestamp": 1711234569,
"rateLimit": {
"limit": 2000,
"remaining": 1997,
"reset": 1711234627
}
}
}
Discovery
Get Connections
List available chain-to-chain swap connections
GET
/
v1
/
connections
Get token pair connections
curl --request GET \
--url https://api.hypermid.io/v1/connections \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.hypermid.io/v1/connections"
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://api.hypermid.io/v1/connections', 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.hypermid.io/v1/connections",
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://api.hypermid.io/v1/connections"
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://api.hypermid.io/v1/connections")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hypermid.io/v1/connections")
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{
"data": {
"connections": [
{
"fromChainId": 1,
"toChainId": 42161,
"fromTokens": [
{
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH"
},
{
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"symbol": "USDC"
}
],
"toTokens": [
{
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH"
},
{
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"symbol": "USDC"
}
],
"tools": ["stargate", "hop", "across"]
}
]
},
"error": null,
"meta": {
"requestId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"timestamp": 1711234569,
"rateLimit": {
"limit": 2000,
"remaining": 1997,
"reset": 1711234627
}
}
}
Returns the available connections between chains, showing which chain pairs support direct swaps and which tools are available for each connection.
Filter connections by source chain ID.
Filter connections by destination chain ID.
Filter by source token address.
Filter by destination token address.
{
"data": {
"connections": [
{
"fromChainId": 1,
"toChainId": 42161,
"fromTokens": [
{
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH"
},
{
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"symbol": "USDC"
}
],
"toTokens": [
{
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH"
},
{
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"symbol": "USDC"
}
],
"tools": ["stargate", "hop", "across"]
}
]
},
"error": null,
"meta": {
"requestId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"timestamp": 1711234569,
"rateLimit": {
"limit": 2000,
"remaining": 1997,
"reset": 1711234627
}
}
}
const connections = await client.getConnections({
fromChain: 1,
toChain: 42161,
});
for (const conn of connections.data.connections) {
console.log(`${conn.fromChainId} -> ${conn.toChainId}: ${conn.tools.join(", ")}`);
}
curl "https://api.hypermid.io/v1/connections?fromChain=1&toChain=42161" \
-H "X-API-Key: your-api-key"
req, _ := http.NewRequest("GET",
"https://api.hypermid.io/v1/connections?fromChain=1&toChain=42161", nil)
req.Header.Set("X-API-Key", "your-api-key")
resp, _ := http.DefaultClient.Do(req)
Authorizations
Partner API key. Optional for public endpoints, required for /v1/partner/*.
Query Parameters
Source chain ID
Source token address
Destination chain ID
Destination token address
⌘I