Skip to Content
Finkhoz

Getting started

Make your first request to the Finkhoz Platform API.

1. Get your API key and approve your IP

Finkhoz sends you an API key (starting with fk_live_) and approves the IP addresses of the servers that will call the API. Keep your key secret: store it in your server's configuration or a secrets manager, never in your code repository or in a browser or mobile app.

2. Check your setup

Call /v1/whoami from one of your approved servers:

curl https://api.finkhoz.com/platform/v1/whoami \
  -H "Authorization: Bearer $FINKHOZ_API_KEY"

A working setup returns your account details and the IP address the API saw:

{
  "status": "success",
  "data": [ { "developer_id": 1, "key_id": 2, "client_ip": "203.0.113.25" } ]
}

If you get 403 IP address not allowed: <ip>, ask Finkhoz to approve the IP shown in the message.

3. Get market data

curl https://api.finkhoz.com/platform/v1/market/pulse \
  -H "Authorization: Bearer $FINKHOZ_API_KEY"

The same request in other languages:

JavaScript (Node.js 18+)

const res = await fetch('https://api.finkhoz.com/platform/v1/market/pulse', {
  headers: { Authorization: `Bearer ${process.env.FINKHOZ_API_KEY}` },
});
const body = await res.json();
console.log(body.data);

Python

import os
import requests

res = requests.get(
    "https://api.finkhoz.com/platform/v1/market/pulse",
    headers={"Authorization": f"Bearer {os.environ['FINKHOZ_API_KEY']}"},
    timeout=30,
)
print(res.json()["data"])

Go

req, _ := http.NewRequest("GET", "https://api.finkhoz.com/platform/v1/market/pulse", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("FINKHOZ_API_KEY"))
resp, err := http.DefaultClient.Do(req)

4. Get analytics for a stock

Analytics endpoints identify a stock by its exchange (NSE or BSE) and token.

  1. Download the instrument list once from /v1/masterdata and store it on your side. It is large and has a strict rate limit, so refresh it at most once a day.
  2. Find the stock's exch_id and token in that list.
  3. Call the analytics endpoint with them, for example HDFC Bank on NSE:
curl https://api.finkhoz.com/platform/v1/analytics/NSE/1333/overview \
  -H "Authorization: Bearer $FINKHOZ_API_KEY"

An unknown token returns 200 with an empty data list, not an error.

Tips

  • URL-encode query values. For example, /v1/has-label?key=NSE#1333 must be sent as /v1/has-label?key=NSE%231333, because # has a special meaning in URLs.
  • Parameter values are case-sensitive. tab=gainers works, tab=Gainers does not.
  • Cache what does not change often, such as masterdata, to stay within your rate limit.

On this page