{"id":7861,"library":"webflow","title":"Webflow Python SDK","description":"The Webflow Python Library provides convenient access to the Webflow Data API from applications written in Python. It includes type definitions for all request and response fields, and offers both synchronous and asynchronous clients powered by `httpx`. The library is actively maintained, with regular updates through Fern regeneration, and is currently at version 2.0.0.","status":"active","version":"2.0.0","language":"en","source_language":"en","source_url":"https://github.com/webflow/webflow-python","tags":["api-client","webflow","sdk","codegen","rest"],"install":[{"cmd":"pip install webflow","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Powers synchronous and asynchronous client requests.","package":"httpx","optional":false},{"reason":"Used for data validation and parsing.","package":"pydantic","optional":false},{"reason":"Core dependency for Pydantic for enhanced performance.","package":"pydantic-core","optional":false},{"reason":"Provides backported and experimental type hints.","package":"typing_extensions","optional":false}],"imports":[{"symbol":"Webflow","correct":"from webflow.client import Webflow"},{"symbol":"AsyncWebflow","correct":"from webflow.client import AsyncWebflow"}],"quickstart":{"code":"import os\nfrom webflow.client import Webflow\n\n# It's recommended to store your API token securely, e.g., in an environment variable\nWEBFLOW_ACCESS_TOKEN = os.environ.get('WEBFLOW_ACCESS_TOKEN', 'YOUR_WEBFLOW_ACCESS_TOKEN')\n\nif not WEBFLOW_ACCESS_TOKEN or WEBFLOW_ACCESS_TOKEN == 'YOUR_WEBFLOW_ACCESS_TOKEN':\n    print(\"Warning: Please set the WEBFLOW_ACCESS_TOKEN environment variable or replace 'YOUR_WEBFLOW_ACCESS_TOKEN' with your actual token.\")\nelse:\n    try:\n        client = Webflow(access_token=WEBFLOW_ACCESS_TOKEN)\n        # Example: List all sites\n        sites_response = client.sites.list()\n        if sites_response.sites:\n            print(f\"Found {len(sites_response.sites)} site(s):\")\n            for site in sites_response.sites:\n                print(f\"- Site Name: {site.display_name}, ID: {site.id}\")\n        else:\n            print(\"No sites found or token lacks sufficient permissions.\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")","lang":"python","description":"Initializes the synchronous Webflow client using an API access token and demonstrates fetching a list of sites. For asynchronous operations, use `AsyncWebflow` and `await` calls."},"warnings":[{"fix":"Consult the official Webflow API documentation and SDK changelog to adapt your code to new method signatures or data structures. Re-generate types if you are relying on code generation.","message":"Major version bump to v2.0.0 due to 'Fern Regeneration' may introduce breaking changes in API method signatures, response object structures, or enum values. Review the Webflow API reference documentation for specific changes if upgrading from v1.x.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Update your code to expect an object (e.g., `client.assets.list().items` if the object contains a list under an 'items' key) instead of directly iterating over the return value of `assets.list()`.","message":"In v1.2.0, the return type of `assets.list` was changed from an array (`Asset[]`) to an object. Code expecting an array for this endpoint will break.","severity":"breaking","affected_versions":">=1.2.0"},{"fix":"Keep `webflow` library updated to the latest stable version to benefit from security patches, or ensure `httpx` and `httpcore` dependencies are updated to secure versions manually if managing them directly.","message":"The SDK relies on `httpcore` for HTTP client functionality. Versions `2.0.0b2` and `2.0.0` included a patch to address a `httpcore` vulnerability. Ensure your environment has the latest patch if you pin `httpcore` or `httpx` versions manually.","severity":"gotcha","affected_versions":">=2.0.0b2"},{"fix":"Thoroughly review the OAuth documentation in the Webflow Developer Docs and ensure all parameters (e.g., `client_id`, `client_secret`, `redirect_uri`, `scope`) are correctly configured in both your Webflow App settings and your Python application. Pay attention to authorization URL generation and access token retrieval steps.","message":"Incorrect OAuth 2.0 configuration, such as misconfigured `redirect_uri`, `client_id`, or `client_secret`, can lead to authentication failures.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run `pip install webflow` to install the library.","cause":"The `webflow` library is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'webflow'"},{"fix":"Verify that your `WEBFLOW_ACCESS_TOKEN` environment variable or hardcoded token is correct and active. Check the permissions associated with your API token in the Webflow dashboard. Some endpoints require Workspace Tokens, while others require Site Tokens.","cause":"The `access_token` provided to the `Webflow` client is invalid, expired, or lacks the necessary permissions.","error":"webflow.core.api_error.ApiError: Invalid API Key"},{"fix":"Consult the latest Webflow Python SDK documentation or API reference to ensure you are using the correct method names and object structures, especially after upgrading the library. Refer to the `webflow-python` GitHub README for current usage patterns.","cause":"Attempting to call a method or access an attribute on the `Webflow` client that does not exist or has been renamed due to API changes or SDK regeneration.","error":"AttributeError: 'Webflow' object has no attribute 'non_existent_method'"}]}