{"library":"mapbox","title":"Mapbox Python SDK","description":"The Mapbox Python SDK is an official client library for interacting with various Mapbox APIs, including Geocoding, Directions, Matrix, Static Images, and Uploads. It simplifies API requests and response handling. The current version is 0.18.1, and it maintains an active development cadence with regular updates addressing API changes and new features.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install mapbox"],"cli":null},"imports":["from mapbox import Geocoder","from mapbox import Directions","from mapbox import Matrix","from mapbox import Static","from mapbox import Uploads","from mapbox import Mapbox"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom mapbox import Geocoder\n\n# Ensure your Mapbox access token is set as an environment variable (e.g., export MAPBOX_ACCESS_TOKEN=\"sk.YOUR_SECRET_TOKEN\")\n# For server-side APIs like Geocoding, a secret (sk.) token is usually required.\naccess_token = os.environ.get('MAPBOX_ACCESS_TOKEN', 'YOUR_MAPBOX_SECRET_TOKEN')\n\nif access_token == 'YOUR_MAPBOX_SECRET_TOKEN':\n    print(\"WARNING: MAPBOX_ACCESS_TOKEN environment variable not set or placeholder used.\\nPlease set it to your actual Mapbox secret access token for the quickstart to function.\")\n    # Using a dummy token for code structure, this will fail API calls.\n    access_token = \"sk.dummy_token_for_example\"\n\ngeocoder = Geocoder(access_token=access_token)\n\n# Perform a forward geocode lookup\nresponse = geocoder.forward('1600 Amphitheatre Pkwy, Mountain View, CA')\n\nif response.status_code == 200:\n    data = response.json()\n    if data and data.get('features'):\n        first_result = data['features'][0]\n        print(f\"Location: {first_result['place_name']}\")\n        print(f\"Coordinates (lon, lat): {first_result['center']}\")\n    else:\n        print(\"No features found.\")\nelse:\n    print(f\"Error: {response.status_code} - {response.json().get('message', 'Unknown error')}\")","lang":"python","description":"This quickstart demonstrates how to initialize the Mapbox Geocoder client using an access token from an environment variable and perform a basic forward geocode lookup. For server-side APIs, ensure you use a secret (sk.) access token with appropriate scopes.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"0.18.1","pypi_latest":"0.18.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":4.7,"avg_import_s":1.12,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"mapbox","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.14,"mem_mb":19.1,"disk_size":"54.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"mapbox","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.1,"import_time_s":0.79,"mem_mb":19.1,"disk_size":"56M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"mapbox","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.35,"mem_mb":21.4,"disk_size":"58.0M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"mapbox","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.7,"import_time_s":1.17,"mem_mb":21.4,"disk_size":"59M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"mapbox","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.31,"mem_mb":20.9,"disk_size":"49.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"mapbox","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.9,"import_time_s":1.17,"mem_mb":20.9,"disk_size":"50M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"mapbox","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.25,"mem_mb":21.5,"disk_size":"49.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"mapbox","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.8,"import_time_s":1.16,"mem_mb":21.5,"disk_size":"50M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"mapbox","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.97,"mem_mb":18.2,"disk_size":"53.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"mapbox","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.9,"import_time_s":0.86,"mem_mb":18.2,"disk_size":"55M"}]}}