cURL
curl --request GET \
--url https://api.tilt.io/api/v1/indexes/{index_id}/levels \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.tilt.io/api/v1/indexes/{index_id}/levels"
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.tilt.io/api/v1/indexes/{index_id}/levels', 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.tilt.io/api/v1/indexes/{index_id}/levels",
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.tilt.io/api/v1/indexes/{index_id}/levels"
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.tilt.io/api/v1/indexes/{index_id}/levels")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tilt.io/api/v1/indexes/{index_id}/levels")
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{
"meta": {
"index_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"data": {
"effective_date": "2023-12-25",
"publish_datetime": "2023-11-07T05:31:56Z",
"index_name": "<string>",
"currency": "<string>",
"return_type": "<string>",
"index_level": "<string>",
"index_market_cap": "<string>",
"constituent_count": 123,
"daily_return": "<string>",
"one_year_return": "<string>",
"five_year_return": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Indexes
Get Index Levels
Index level for a date. With no date, returns the most recent published level (the latest level date). A date with no published level returns 404..
GET
/
api
/
v1
/
indexes
/
{index_id}
/
levels
cURL
curl --request GET \
--url https://api.tilt.io/api/v1/indexes/{index_id}/levels \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.tilt.io/api/v1/indexes/{index_id}/levels"
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.tilt.io/api/v1/indexes/{index_id}/levels', 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.tilt.io/api/v1/indexes/{index_id}/levels",
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.tilt.io/api/v1/indexes/{index_id}/levels"
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.tilt.io/api/v1/indexes/{index_id}/levels")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tilt.io/api/v1/indexes/{index_id}/levels")
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{
"meta": {
"index_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"data": {
"effective_date": "2023-12-25",
"publish_datetime": "2023-11-07T05:31:56Z",
"index_name": "<string>",
"currency": "<string>",
"return_type": "<string>",
"index_level": "<string>",
"index_market_cap": "<string>",
"constituent_count": 123,
"daily_return": "<string>",
"one_year_return": "<string>",
"five_year_return": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Description
Retrieves the levels for a specific index.Parameters
Path Parameters
| Parameter | Required | Description |
|---|---|---|
index_id | Yes | The unique identifier of the index |
Query Parameters
| Parameter | Required | Description |
|---|---|---|
date | No | Effective date in YYYY-MM-DD format. Defaults to the most recent available date. |
Default Behavior
- If
dateis not provided, returns levels for the most recent available date
⌘I