{"id":9979,"library":"nominal-api","title":"Nominal API Python Client","description":"The official Python client for the Nominal API, providing programmatic access to financial time-series data, including inflation, economic indicators, and asset prices. The library is actively maintained and frequently updated, often releasing new versions with minor bug fixes and feature enhancements, though breaking changes can occur in pre-1.0 releases.","status":"active","version":"0.1198.0","language":"en","source_language":"en","source_url":"https://github.com/nominal-api/nominal-api-python","tags":["api-client","financial-data","time-series","economics"],"install":[{"cmd":"pip install nominal-api","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Used internally for making HTTP requests to the Nominal API.","package":"requests","optional":false}],"imports":[{"note":"The main client class was renamed from `NominalClient` to `NominalAPIClient` in version 0.1170.0.","wrong":"from nominal import NominalClient","symbol":"NominalAPIClient","correct":"from nominal import NominalAPIClient"}],"quickstart":{"code":"import os\nfrom nominal import NominalAPIClient\n\napi_key = os.environ.get('NOMINAL_API_KEY', 'YOUR_NOMINAL_API_KEY_HERE')\n\nif api_key == 'YOUR_NOMINAL_API_KEY_HERE':\n    print(\"Please set the NOMINAL_API_KEY environment variable or replace 'YOUR_NOMINAL_API_KEY_HERE' with your actual key.\")\nelse:\n    try:\n        client = NominalAPIClient(api_key=api_key)\n        # Fetch CPI data for USD between specified dates\n        timeseries_data = client.get_timeseries(\"USD.CPI\", \"2020-01-01\", \"2020-12-31\")\n        print(\"Successfully fetched data:\")\n        print(f\"First entry: {timeseries_data[0]}\")\n        print(f\"Last entry: {timeseries_data[-1]}\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")","lang":"python","description":"Initialize the NominalAPIClient with your API key and fetch time-series data. This example retrieves CPI data for USD for the year 2020. Ensure your API key is configured either as an environment variable or directly in the code."},"warnings":[{"fix":"Update your import statement from `from nominal import NominalClient` to `from nominal import NominalAPIClient` and all instantiations.","message":"The main client class name changed from `NominalClient` to `NominalAPIClient`.","severity":"breaking","affected_versions":">=0.1170.0"},{"fix":"Convert any `datetime` objects passed as `start` or `end` parameters to strings using `date_object.strftime('%Y-%m-%d')`.","message":"Date parameters for `get_timeseries` and similar methods now require string formats ('YYYY-MM-DD') instead of `datetime` objects.","severity":"breaking","affected_versions":">=0.1187.0"},{"fix":"Always pin your `nominal-api` version in production environments (`nominal-api==X.Y.Z`) and test thoroughly when upgrading to a new version.","message":"The library is still in a pre-1.0 major version (0.x.x), meaning backward-incompatible changes can be introduced in minor or patch releases.","severity":"gotcha","affected_versions":"<1.0.0"},{"fix":"Always load your `NOMINAL_API_KEY` from environment variables, a secure vault, or a configuration file that is not committed to source control.","message":"API keys are sensitive. Exposing them in source control or public environments is a security risk.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Change the import to `from nominal import NominalAPIClient`.","cause":"Attempting to import the old client class name after version 0.1170.0.","error":"ImportError: cannot import name 'NominalClient' from 'nominal'"},{"fix":"Ensure you are importing and instantiating `NominalAPIClient`, e.g., `client = NominalAPIClient(...)`.","cause":"You've likely instantiated `NominalClient` (the old class name) which no longer exists or has different methods in newer versions. This can also happen if your code imports an older `NominalClient` then tries to use methods only available on the new `NominalAPIClient`.","error":"AttributeError: 'NominalClient' object has no attribute 'get_timeseries'"},{"fix":"Double-check your API key for typos. If loading from an environment variable, ensure it's correctly set. Regenerate your key from the Nominal API dashboard if necessary.","cause":"The provided API key is incorrect, expired, or has insufficient permissions.","error":"nominal.exceptions.NominalAPIError: Invalid API Key (Status code: 401)"},{"fix":"Ensure all date parameters are strings formatted as 'YYYY-MM-DD'. If converting from `datetime` objects, use `date_object.strftime('%Y-%m-%d')`.","cause":"Dates are not provided in the required 'YYYY-MM-DD' string format, especially after version 0.1187.0.","error":"nominal.exceptions.NominalAPIError: Invalid date format for parameter 'start' (Status code: 400)"}]}