Skip to Main Content
POST/NorenWClientAPI/SearchScrip

Search Scrip

Search for tradable symbols by name or partial text on a given exchange, returning matching tokens and trading symbols.

API Endpoint

MethodPOST
URLhttps://api.shoonya.com/NorenWClientAPI/SearchScrip
Content-Typeapplication/x-www-form-urlencoded
PayloadjData=<JSON payload>&jKey=<AccessToken> — requires a valid AccessToken from Login.

Overview

SearchScrip resolves a free-text search string (stext) into one or more matching contracts on an exchange, each with its numeric token. This is the standard way to go from a human-readable symbol to the token required by Get Quotes, Place Order, and the streaming APIs.

Purpose

Use this for building a symbol search/autocomplete UI, or programmatically resolving an option/future symbol (e.g. a specific strike and expiry) before placing an order or subscribing to its feed. For bulk/offline lookups across the whole instrument universe, prefer downloading the Symbol Master file instead of calling this endpoint per symbol.

Parameters

FieldTypeRequiredDescription
uidstringrequiredYour account/client ID.
exchstringrequiredExchange segment to search within, e.g. NSE, NFO, BSE, MCX.
stextstringrequiredSearch text — full or partial trading symbol. For derivatives, the exact contract string (e.g. NIFTY28JUL26C24100) must match the exchange's naming convention precisely.

Request example

import requests
import json

jdata = {"uid": "ABC1234", "exch": "NFO", "stext": "NIFTY28JUL26C24100"}
payload = "jData=" + json.dumps(jdata) + "&jKey=" + Acesstoken

headers = {"Content-Type": "application/x-www-form-urlencoded"}
resp = requests.post("https://api.shoonya.com/NorenWClientAPI/SearchScrip",
                      data=payload, headers=headers)
print(resp.json())
const jdata = { uid: "ABC1234", exch: "NFO", stext: "NIFTY28JUL26C24100" };
const payload = "jData=" + JSON.stringify(jdata) + "&jKey=" + Acesstoken;

const res = await fetch("https://api.shoonya.com/NorenWClientAPI/SearchScrip", {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: payload,
});
console.log(await res.json());
curl -X POST https://api.shoonya.com/NorenWClientAPI/SearchScrip \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode 'jData={"uid":"ABC1234","exch":"NFO","stext":"NIFTY28JUL26C24100"}' \
  --data-urlencode "jKey=$Acesstoken"

Response example

json
{
  "stat": "Ok",
  "values": [
    {
      "exch": "NFO",
      "token": "48291",
      "tsym": "NIFTY28JUL26C24100",
      "cname": "NIFTY",
      "instname": "OPTIDX",
      "optt": "CE",
      "strprc": "24100.00",
      "pp": "2",
      "ls": "75",
      "ti": "0.05"
    }
  ]
}

Error handling

ResponseMeaning
{"stat":"Not_Ok","emsg":"No Data : "}No contract matched stext on the given exch — usually means the symbol/expiry string doesn't match exchange naming, or the contract hasn't been listed for that expiry yet. This is a normal "no results" response, not a transport error — the HTTP status is 404 but the body is well-formed.
Session_ExpiredAccess token expired or invalid — re-authenticate via Token Renewal.

Best practices

  • Always check stat before reading values — a "no match" response still returns HTTP 404 with a JSON body, so don't assume a non-200 means the request itself failed.
  • For option contracts, get the exact tsym format from Option Chain or the Symbol Master rather than hand-building the string — a one-character mismatch in date/strike format returns zero matches.
  • Cache resolved tokens for the trading session; tokens are stable intraday.

Python example

python
from shoonya_api import ShoonyaClient

client = ShoonyaClient(session_token=Acesstoken)
matches = client.search_scrip(exchange="NFO", search_text="NIFTY28JUL26C24100")
if not matches:
    print("No contract found — check expiry/strike format")
else:
    print(matches[0].token, matches[0].tsym)

Notes

Your debug log's 404 for NIFTY28JUL26C24100 on NFO is a no-match response, not a service error — worth double-checking the expiry date/strike format against a symbol you know is currently listed (e.g. via Option Chain) before assuming the API itself is broken.