As part of our migration to DIA’s next-generation oracle infrastructure, Lumina, the hosted DIA GraphQL API is being deprecated and will be discontinued on 20 December 2026. This affects the GraphQL endpoint at
https://api.diadata.org/graphql.If your protocol relies on this, please email support@diadata.org and confirm that you are using it. We will provide you with a migration path so you can continue accessing the same data through Lumina without interruption. Integrations that don’t reach out may lose access after the deprecation date.Python
Python
import requests
import json
url = "https://api.diadata.org/graphql/query"
query = """
{
GetFeed(
Filter: "mair",
BlockSizeSeconds: 480,
BlockShiftSeconds: 480,
StartTime: 1690449575,
EndTime: 1690535975,
FeedSelection: [
{
Address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
Blockchain:"Ethereum",
Exchangepairs:[],
},
],
)
{
Name
Time
Value
Pools
Pairs
}
}
"""
headers = {
"Content-Type": "application/json"
}
data = {
"query": query
}
response = requests.post(url, headers=headers, data=json.dumps(data))
if response.status_code == 200:
# Print the response content
print(response.json())
else:
print("Request failed with status code:", response.status_code)
GO
GO
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.diadata.org/graphql/query"
query := `
GetFeed(
Filter: "mair",
BlockSizeSeconds: 480,
BlockShiftSeconds: 480,
StartTime: 1690449575,
EndTime: 1690535975,
FeedSelection: [
{
Address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
Blockchain:"Ethereum",
Exchangepairs:[],
},
],
)
{
Name
Time
Value
Pools
Pairs
}
}
`
requestBody, err := json.Marshal(map[string]string{
"query": query,
})
if err != nil {
fmt.Println("Failed to create request body:", err)
return
}
response, err := http.Post(url, "application/json", bytes.NewBuffer(requestBody))
if err != nil {
fmt.Println("Request failed:", err)
return
}
defer response.Body.Close()
if response.StatusCode == http.StatusOK {
var data map[string]interface{}
err = json.NewDecoder(response.Body).Decode(&data)
if err != nil {
fmt.Println("Failed to decode response JSON:", err)
return
}
fmt.Println(data)
} else {
fmt.Println("Request failed with status code:", response.StatusCode)
}
}
JavaScript
JavaScript
const axios = require('axios');
const url = 'https://api.diadata.org/graphql/query';
const query = `
{
GetFeed(
Filter: "mair",
BlockSizeSeconds: 480,
BlockShiftSeconds: 480,
StartTime: 1690449575,
EndTime: 1690535975,
FeedSelection: [
{
Address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
Blockchain:"Ethereum",
Exchangepairs:[],
},
],
)
{
Name
Time
Value
Pools
Pairs
}
} }
`;
const data = {
query: query
};
axios.post(url, data)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Request failed:', error.message);
});
Node
Node
const fetch = require('node-fetch');
const url = 'https://api.diadata.org/graphql/query';
const query = `
{
GetFeed(
Filter: "mair",
BlockSizeSeconds: 480,
BlockShiftSeconds: 480,
StartTime: 1690449575,
EndTime: 1690535975,
FeedSelection: [
{
Address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
Blockchain:"Ethereum",
Exchangepairs:[],
},
],
)
{
Name
Time
Value
Pools
Pairs
}
}
`;
const data = JSON.stringify({ query });
fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: data
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Request failed:', error);
});
Rust
Rust
use reqwest;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let url = "https://api.diadata.org/graphql/query";
let query = r#"
{
{
GetFeed(
Filter: "mair",
BlockSizeSeconds: 480,
BlockShiftSeconds: 480,
StartTime: 1690449575,
EndTime: 1690535975,
FeedSelection: [
{
Address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
Blockchain:"Ethereum",
Exchangepairs:[],
},
],
)
{
Name
Time
Value
Pools
Pairs
}
}
"#;
let data = json!({
"query": query,
});
let client = reqwest::Client::new();
let response = client
.post(url)
.json(&data)
.send()
.await?;
if response.status().is_success() {
let body = response.text().await?;
println!("{}", body);
} else {
println!("Request failed with status code: {}", response.status());
}
Ok(())
}
PHP
PHP
<?php
$url = 'https://api.diadata.org/graphql/query';
$query = '
{
GetFeed(
Filter: "mair",
BlockSizeSeconds: 480,
BlockShiftSeconds: 480,
StartTime: 1690449575,
EndTime: 1690535975,
FeedSelection: [
{
Address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
Blockchain:"Ethereum",
Exchangepairs:[],
},
],
)
{
Name
Time
Value
Pools
Pairs
}
}
';
$data = array(
'query' => $query
);
$options = array(
CURLOPT_URL => $url,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
CURLOPT_RETURNTRANSFER => true
);
$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Request failed with error: ' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>