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-typeas1(price-based alert).comparisonTypepicks the price that is checked:LTP,OPEN,HIGH,LOWorCLOSE. conditionacceptsGT,GTE,LT,LTEor equality. The reference lists equality asEin the Condition table and as==in the request attributes.symbolmust be the full trading symbol, for exampleNSE:SBIN-EQ.nameis only your own label for the alert.- A successful call returns code
120and a confirmation message only. Read thealertIdfor 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 Values | Description |
|---|---|
LTP | LTP |
HIGH | High Price |
LOW | Low Price |
OPEN | Open Price |
CLOSE | Close Price |
Condition
| Possible Values | Description |
|---|---|
GT | Greater than (>) |
GTE | Greater than equal to (>=) |
LT | Less than |
LTE | Less than equal to (<=) |
E | Equal to |
Alert Type
| Possible Values | Description |
|---|---|
1 | v / LTP |
Request Attributes
| Attribute | Data Type | Description |
|---|---|---|
agent | string | Source of alert creation. Eg: "fyers-api" |
alert-type | int | Type of alert. 1 price-based alert. |
name | string | User-provided label for alert. |
symbol | string | Full trading symbol (e.g., "NSE:SBIN-EQ") |
comparisonType | string | price metric. Allowed: "OPEN", "HIGH", "LOW", "CLOSE", "LTP" |
condition | string | comparison operator. Allowed: "GT" (greater), "GTE" (greater or equal), "LT" (lesser), "LTE" (lesser or equal), "==" (equal) |
value | float | Target price for comparison. |
Response Attributes
| Attribute | Data Type | Description |
|---|---|---|
code | int | Numeric response/status code returned by the API (e.g. 120 on successful alert creation). |
message | string | Human-readable message describing the result of the alert creation request. |
s | string | Status of the response. Possible value: "ok" for a successful request. |
Last updated on