Registry / finance / fyers-apiv3

fyers-apiv3

JSON →
library3.1.13pypypi✓ verified 86d ago

Python library for the Fyers trading platform's REST API (v3). Current version 3.1.13, released weekly with minor updates.

pip install fyers-apiv3
INSTALL
IMPORT
SIG · FYERS-APIV3
F
fyers-apiv3
financepythonv3.1.13
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FyersModel
from fyers_apiv3 import fyersModel
from fyers_apiv3.FyersModel import FyersModel
Direct class import fails; import module and use fyersModel.FyersModel()

Initialize FyersModel with client_id and access_token. Use is_async=False for synchronous calls.

from fyers_apiv3 import fyersModel import os # Replace with your credentials client_id = os.environ.get('FYERS_CLIENT_ID', '') access_token = os.environ.get('FYERS_ACCESS_TOKEN', '') # Initialize Fyers model fyers = fyersModel.FyersModel(client_id=client_id, token=access_token, is_async=False, log_path='') # Get profile profile = fyers.get_profile() print(profile)
Debug
Known issues
breakingAccess token must be obtained via OAuth flow; the library does not handle authentication. Use get_token endpoint separately.
fix
Implement the OAuth flow to get an access token, then pass it to FyersModel.
affects: all
deprecatedHistorical data endpoint changed from /data/history to /history in v3.0.0.
fix
Use fyers.history() instead of fyers.data() for historical data.
affects: <3.0.0
gotchaThe library uses synchronous requests by default; set is_async=True for async mode, but then must await all API calls.
fix
For sync: is_async=False (default). For async: is_async=True and use await.
affects: all
gotchaAll dates in API requests must be in 'YYYY-MM-DD' format. Time fields are optional and default to market hours.
fix
Use datetime.strftime('%Y-%m-%d') when formatting dates.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'fyers_api'
Installing wrong package (fyers_api is v1/v2).
fix
Run: pip install fyers-apiv3
AttributeError: module 'fyers_apiv3' has no attribute 'FyersModel'
Trying to import FyersModel directly from the package root.
fix
Use 'from fyers_apiv3 import fyersModel' then 'fyersModel.FyersModel(...)'
KeyError: 's' (in JSON response)
Invalid or expired access token.
fix
Ensure token is valid and not expired. Re-authenticate via OAuth.
requests.exceptions.HTTPError: 400 Client Error: Bad Request
Missing or malformed required parameters (e.g., symbol format).
fix
Check API request for required fields like 'symbol' in proper format (e.g., 'NSE:SBIN-EQ').
Upgrade
Version history
3.1.13latest on PyPI · released Jun 5, 2026
Audit
Dependencies
requestsrequiredHTTP client for API calls
pyotprequiredTOTP generation for two-factor authentication
Agent activity
38 hits · last 30 days
node
31
Amazon
1
OpenAI (training)
1
Resources
fyers-apiv3 — pip install fyers-apiv3 · libregistry