Skip to Content
API ReferencePrice AlertsCreate Price Alert

Create Price Alert

This API allows you to create a price alert for an instrument.

USE CASE

Get notified when an instrument, such as NSE:SBIN-EQ, crosses a price you choose.

FYERS watches the price, so your app does not have to poll quotes.

Details

  • You can create a new price alert using this API. Alerts can be configured based on the following parameters.
  • Send alert-type as 1 (price-based alert). comparisonType picks the price that is checked: LTP, OPEN, HIGH, LOW or CLOSE.
  • condition accepts GT, GTE, LT, LTE or equality. The reference lists equality as E in the Condition table and as == in the request attributes.
  • symbol must be the full trading symbol, for example NSE:SBIN-EQ. name is only your own label for the alert.
  • A successful call returns code 120 and a confirmation message only. Read the alertId for later calls from Get Price Alerts.
  • Triggered alerts arrive on the General WebSocket under pricealerts, which also pushes a message when an alert is created.
  • Rate limits differ between the Standard and Prime plans. See Plans & rate limits.

Comparison Type

Possible ValuesDescription
LTPLTP
HIGHHigh Price
LOWLow Price
OPENOpen Price
CLOSEClose Price

Condition

Possible ValuesDescription
GTGreater than (>)
GTEGreater than equal to (>=)
LTLess than
LTELess than equal to (<=)
EEqual to

Alert Type

Possible ValuesDescription
1v / LTP

Request Attributes

AttributeData TypeDescription
agentstringSource of alert creation. Eg: "fyers-api"
alert-typeintType of alert. 1 price-based alert.
namestringUser-provided label for alert.
symbolstringFull trading symbol (e.g., "NSE:SBIN-EQ")
comparisonTypestringprice metric. Allowed: "OPEN", "HIGH", "LOW", "CLOSE", "LTP"
conditionstringcomparison operator. Allowed: "GT" (greater), "GTE" (greater or equal), "LT" (lesser), "LTE" (lesser or equal), "==" (equal)
valuefloatTarget price for comparison.

Response Attributes

AttributeData TypeDescription
codeintNumeric response/status code returned by the API (e.g. 120 on successful alert creation).
messagestringHuman-readable message describing the result of the alert creation request.
sstringStatus of the response. Possible value: "ok" for a successful request.
Last updated on