{"id":45003,"library":"fyers-apiv3","title":"Fyers API v3","description":"Python library for the Fyers trading platform's REST API (v3). Current version 3.1.13, released weekly with minor updates.","status":"active","version":"3.1.13","language":"python","source_language":"en","source_url":"https://github.com/FyersDev/fyers-api-sample-code/tree/sample_v3/v3/python","tags":["fyers","trading","stock-market","api"],"install":[{"cmd":"pip install fyers-apiv3","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false},{"reason":"TOTP generation for two-factor authentication","package":"pyotp","optional":false}],"imports":[{"note":"Direct class import fails; import module and use fyersModel.FyersModel()","wrong":"from fyers_apiv3.FyersModel import FyersModel","symbol":"FyersModel","correct":"from fyers_apiv3 import fyersModel"}],"quickstart":{"code":"from fyers_apiv3 import fyersModel\nimport os\n\n# Replace with your credentials\nclient_id = os.environ.get('FYERS_CLIENT_ID', '')\naccess_token = os.environ.get('FYERS_ACCESS_TOKEN', '')\n\n# Initialize Fyers model\nfyers = fyersModel.FyersModel(client_id=client_id, token=access_token, is_async=False, log_path='')\n\n# Get profile\nprofile = fyers.get_profile()\nprint(profile)","lang":"python","description":"Initialize FyersModel with client_id and access_token. Use is_async=False for synchronous calls."},"warnings":[{"fix":"Implement the OAuth flow to get an access token, then pass it to FyersModel.","message":"Access token must be obtained via OAuth flow; the library does not handle authentication. Use get_token endpoint separately.","severity":"breaking","affected_versions":"all"},{"fix":"Use fyers.history() instead of fyers.data() for historical data.","message":"Historical data endpoint changed from /data/history to /history in v3.0.0.","severity":"deprecated","affected_versions":"<3.0.0"},{"fix":"For sync: is_async=False (default). For async: is_async=True and use await.","message":"The library uses synchronous requests by default; set is_async=True for async mode, but then must await all API calls.","severity":"gotcha","affected_versions":"all"},{"fix":"Use datetime.strftime('%Y-%m-%d') when formatting dates.","message":"All dates in API requests must be in 'YYYY-MM-DD' format. Time fields are optional and default to market hours.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'3.1.13':17 'api':2,13,28 'current':15 'fyer':1,8,23 'librari':5 'market':27 'minor':21 'platform':10 'python':4 'releas':18 'rest':12 'stock':26 'stock-market':25 'trade':9,24 'updat':22 'v3':3,14 'version':16 'week':19","created_at":"2026-06-07T12:52:53.734856+00:00","updated_at":"2026-06-07T12:52:53.734856+00:00","problems":[{"fix":"Run: pip install fyers-apiv3","cause":"Installing wrong package (fyers_api is v1/v2).","error":"ModuleNotFoundError: No module named 'fyers_api'"},{"fix":"Use 'from fyers_apiv3 import fyersModel' then 'fyersModel.FyersModel(...)'","cause":"Trying to import FyersModel directly from the package root.","error":"AttributeError: module 'fyers_apiv3' has no attribute 'FyersModel'"},{"fix":"Ensure token is valid and not expired. Re-authenticate via OAuth.","cause":"Invalid or expired access token.","error":"KeyError: 's' (in JSON response)"},{"fix":"Check API request for required fields like 'symbol' in proper format (e.g., 'NSE:SBIN-EQ').","cause":"Missing or malformed required parameters (e.g., symbol format).","error":"requests.exceptions.HTTPError: 400 Client Error: Bad Request"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/FyersDev/fyers-api-sample-code/tree/sample_v3/v3/python","github":"https://github.com/FyersDev/fyers-api-sample-code/tree/sample_v3/v3/python","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["finance"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}