{"id":23093,"library":"fastly","title":"Fastly Python API Client","description":"Official Python client for the Fastly API. Version 13.1.0 supports all Fastly services (CDN, compute, logging, etc). Requires Python >=3.6. Actively maintained with monthly releases.","status":"active","version":"13.1.0","language":"python","source_language":"en","source_url":"https://github.com/fastly/fastly-py","tags":["fastly","cdn","api-client","cloud-computing"],"install":[{"cmd":"pip install fastly","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"note":"Fastly is a top-level class; import fastly gives module object, not the client.","wrong":"import fastly","symbol":"Fastly","correct":"from fastly import Fastly"},{"note":"Service is a service class under the services module.","wrong":"from fastly import Service","symbol":"Service","correct":"from fastly.services import Service"}],"quickstart":{"code":"from fastly import Fastly\n\napi_token = os.environ.get('FASTLY_API_TOKEN', '')\nclient = Fastly(api_token=api_token)\nprint(client.services.list())","lang":"python","description":"Initialize client and list services."},"warnings":[{"fix":"Use Fastly(api_token='your_token') instead of Fastly('your_token').","message":"In v12+, the client no longer accepts positional arguments for api_token; must use keyword argument.","severity":"breaking","affected_versions":">=12.0.0"},{"fix":"Always provide api_token either via env var or constructor arg.","message":"API token must be set via environment variable FASTLY_API_TOKEN or passed directly; if neither, client issues unauthenticated requests.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace client._request(...) with client.request(...).","message":"The method _request() is deprecated since v11; use client.request() instead.","severity":"deprecated","affected_versions":">=11.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Fastly(api_token='your_token')","cause":"Using positional argument for api_token instead of keyword argument in Fastly constructor (v12+).","error":"TypeError: __init__() takes 1 positional argument but 2 were given"},{"fix":"Pass service_id as keyword argument: client.service.get(service_id='your_id')","cause":"Service ID not provided when calling an endpoint that requires it.","error":"fastly.exceptions.FastlyError: Missing required parameter 'service_id'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}