Skip to Content
API ReferenceAPI Standards

API Standards

Shared rules and conventions for working with FYERS APIs.

Follow these conventions when building requests, handling responses, working with timestamps, interpreting errors, and implementing retries.

Base URLsPermalink for this section

  • Use the host documented on the specific API page.
  • REST APIs and WebSocket services use different hosts.
  • Do not reuse a REST base URL for a socket connection.

AuthenticationPermalink for this section

Transport securityPermalink for this section

FYERS APIs are built with security in mind to prevent unauthorised transactions. All API requests and responses are sent and received only over the HTTPS protocol.

Authorization headerPermalink for this section

After authentication you receive an access_token. Send your App ID and access token together as app_id:access_token in the HTTP Authorization header on every subsequent request.

curl -H "Authorization: app_id:access_token" curl -H "Authorization: aaa-99:bbb"

Send an active access token on authenticated requests. Keep tokens private — never log them or ship them in client-side or public code. Use the exact format on the API page when a documented header differs.

Request and response formatPermalink for this section

  • Follow the method, URL, and fields on that API page.
  • Send required fields in the documented format.
  • Validate the response before using it in a trading workflow.

Success responsePermalink for this section

AttributeData TypeDescription
sstringok
codeint200
messagestringEmpty string on success.
Additional keyobject / list / int / stringEach request returns its own key based on the request.

Failure responsePermalink for this section

AttributeData TypeDescription
sstringerror
codeintNegative integer that identifies the specific error.
messagestringError message that identifies the error.
HTTP headerintHTTP status code. See Common API Error Codes.

HTTP status codesPermalink for this section

Status codeMeaning
200Request was successful.
400Bad request — the request is invalid, or another client-side error occurred.
401Authorization error — the user could not be authenticated.
403Permission error — the user does not have the necessary permissions.
429Rate limit exceeded — the user has been blocked for exceeding the rate limit.
500Internal server error.

Status and error modelPermalink for this section

Read the response code and message together before deciding the next action. Common cases are success, invalid input, auth failure, rate limit and order rejection.

Use Appendix → Common API Error Codes for the standard description and next action of each app-level error code (the negative code values in a failure response).

Timestamps and timezonesPermalink for this section

  • Use the timestamp format shown on the API page.
  • Keep request, storage, and display handling consistent.
  • Do not mix timezone assumptions across systems.

PaginationPermalink for this section

  • Use the pagination fields documented for that endpoint.
  • Continue paging until the required records are retrieved.
  • Stop when the page has no further results.

Rate limits and blockingPermalink for this section

Every plan has per-second, per-minute and per-day request limits — see Plans & Rate Limits for the exact numbers per plan and API category. If the per-minute limit is exceeded more than 3 times in a day, the user is blocked from making further requests for the rest of that day.

Idempotency and retriesPermalink for this section

Retry only when it is safe.

  • Confirm account state before repeating order or position actions.
  • Check that the earlier request did not already succeed.
  • Do not blindly replay requests after timeouts or network errors.

How API pages are structuredPermalink for this section

Every API page follows the same structure, so you always know what to expect.

  1. Understand — What the API does and when to use it.
  2. Check access — Plan availability and access limits.
  3. Prepare — Prerequisites and authentication.
  4. Make the request — Method, URL and request parameters.
  5. Read the response — Response fields and examples.
  6. Handle errors — Error codes and recommended actions. See Common API Error Codes.
Last updated on