Browse documentation
Start

Quickstart

This guide gets a server-side application connected to Drishti with an official SDK.

Prerequisites

  • Node.js 18+ for the JavaScript / TypeScript SDK.
  • Python 3.10+ for the Python SDK.
  • A valid Drishti API key from the platform console.

Get an API key

Open the Drishti platform console, sign in, and go to the developer portal. From there, create or copy an API key for your account.

Open the platform console

Install an SDK

pnpm add drishti-sdk
bash
pip install drishti-sdk

For browser pages without a bundler, load the JavaScript SDK from jsDelivr or unpkg (demos and prototypes only):

html
<script src="https://cdn.jsdelivr.net/npm/drishti-sdk"></script>
<script>
  const { DrishtiClient } = DrishtiSDK;

  const client = new DrishtiClient({ apiKey: "YOUR_API_KEY" });
</script>

Unpkg equivalent: https://unpkg.com/drishti-sdk. Pin a package version in the URL for prototypes, for example https://cdn.jsdelivr.net/npm/[email protected].

Set your API key

Keep API keys on the server. Do not expose them in browser bundles or public environment variables.

bash
DRISHTI_API_KEY="your_api_key"

Fetch news

ts
import { DrishtiClient } from "drishti-sdk"

const client = new DrishtiClient({
  apiKey: process.env.DRISHTI_API_KEY!,
})

const news = await client.getNews({
  symbols: ["RELIANCE", "TCS"],
  limit: 10,
})

console.log(news.data.length)
python
from drishti_sdk import DrishtiClient

with DrishtiClient(api_key="YOUR_API_KEY") as client:
    news = client.get_news(symbols=["RELIANCE", "TCS"], limit=10)
    print(len(news["data"]))

Next steps