QuickStart Guide
Last updated
Last updated
Follow these quick steps to begin using the ADI API:
Obtain an API Key To access the ADI API, you'll need an API key. Once approved, we'll provide you with a unique key to unlock a variety of endpoints.
Tip: Keep your API key secure and avoid sharing it publicly.
Explore Available Endpoints Browse the to discover the data and features the ADI API offers. Each endpoint includes detailed descriptions, input parameters, and example responses.
Make a test call with your API Key. You can check out the code examples below to make a test call.
import requests
api_key = "YOUR_API_KEY"
url = "https://api.adiinvestments.net/v1/stock/quote/AAPL"
headers = {
"X-API-Key": api_key
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()
print(data)
else:
print(response.text)
const apiKey = "YOUR_API_KEY";
const url = "https://api.adiinvestments.net/v1/stock/quote/AAPL";
const headers = {
"X-API-Key": apiKey
};
fetch(url, { headers })
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error("Error:", error);
});
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) {
String apiKey = "YOUR_API_KEY";
String urlString = "https://api.adiinvestments.net/v1/stock/quote/AAPL";
try {
URL url = new URL(urlString);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("X-API-Key", apiKey);
int statusCode = connection.getResponseCode();
BufferedReader reader;
StringBuilder response = new StringBuilder();
if (statusCode == 200) {
reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
while ((inputLine = reader.readLine()) != null) {
response.append(inputLine);
}
reader.close();
System.out.println(response.toString());
} else {
reader = new BufferedReader(new InputStreamReader(connection.getErrorStream()));
String inputLine;
while ((inputLine = reader.readLine()) != null) {
response.append(inputLine);
}
reader.close();
System.out.println("Error: " + statusCode + " Details: " + response.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
<?php
$apiKey = "YOUR_API_KEY";
$url = "https://api.adiinvestments.net/v1/stock/quote/AAPL";
$headers = [
"X-API-Key: $apiKey"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo "Request error: " . curl_error($ch);
} else {
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode === 200) {
echo $response;
} else {
echo "Error: $httpCode, Details: $response";
}
}
curl_close($ch);
?>
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
string apiKey = "YOUR_API_KEY";
string url = "https://api.adiinvestments.net/v1/stock/quote/AAPL";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
try
{
HttpResponseMessage response = await client.GetAsync(url);
string responseBody = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
Console.WriteLine(responseBody);
}
else
{
Console.WriteLine($"Error: {(int)response.StatusCode}, Details: {responseBody}");
}
}
catch (Exception e)
{
Console.WriteLine($"Request failed: {e.Message}");
}
}
}
}
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
apiKey := "YOUR_API_KEY"
url := "https://api.adiinvestments.net/v1/stock/quote/AAPL"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Add("X-API-Key", apiKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
if resp.StatusCode == 200 {
fmt.Println(string(body))
} else {
fmt.Println("Error:", resp.StatusCode, string(body))
}
}
Replace YOUR_API_KEY
with your actual key and modify the endpoint as needed.