{"id":22343,"library":"scrapinghub","title":"Scrapinghub Python Client","description":"Client interface for the Scrapinghub API, used to manage and monitor scraping jobs, collections, items, and more. Current version is 2.7.0, requires Python >=3.10. Release cadence is irregular.","status":"active","version":"2.7.0","language":"python","source_language":"en","source_url":"https://github.com/scrapinghub/python-scrapinghub","tags":["scrapinghub","scrapy","api-client","web-scraping"],"install":[{"cmd":"pip install scrapinghub","lang":"bash","label":"Latest release"}],"dependencies":[{"reason":"serialization of data","package":"msgpack","optional":false},{"reason":"HTTP client","package":"requests","optional":false},{"reason":"retry logic for HTTP errors","package":"retrying","optional":false}],"imports":[{"note":"Old or incorrect import path. The main class is directly under the package.","wrong":"from scrapinghub.client import ScrapinghubClient","symbol":"ScrapinghubClient","correct":"from scrapinghub import ScrapinghubClient"}],"quickstart":{"code":"from scrapinghub import ScrapinghubClient\n\napi_key = os.environ.get('SHUB_APIKEY', '')\nclient = ScrapinghubClient(api_key)\n\n# Access a project\nproject = client.get_project(123456)\nprint(project.key)\n\n# List jobs (spiders) in a project\nfor job in project.jobs.iter():\n    print(job['key'])","lang":"python","description":"Initialize client with API key, fetch a project, and list jobs."},"warnings":[{"fix":"Replace 'from hubstorage import HubstorageClient' with 'from scrapinghub import ScrapinghubClient'.","message":"The 'hubstorage' package is deprecated and merged into scrapinghub since version 1.9.0. Use 'scrapinghub' instead.","severity":"deprecated","affected_versions":"<1.9.0"},{"fix":"Upgrade to Python 3.10+.","message":"Python 3.3 and 3.4 support dropped in version 2.3.1 and 2.0.0 respectively.","severity":"breaking","affected_versions":">=2.0.0 <2.3.1"},{"fix":"Set either SH_APIKEY or SHUB_JOBAUTH environment variable before creating a client.","message":"The API key can be provided via environment variable 'SH_APIKEY' or 'SHUB_JOBAUTH'. If both are missing, client initialization will fail.","severity":"gotcha","affected_versions":"all"},{"fix":"Use full job key strings when referencing jobs in API calls.","message":"Job IDs are strings in the format 'project_id/spider_id/job_id', not just numeric.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install scrapinghub and change imports to 'from scrapinghub import ScrapinghubClient'.","cause":"The hubstorage package is deprecated and merged into scrapinghub.","error":"ModuleNotFoundError: No module named 'hubstorage'"},{"fix":"from scrapinghub import ScrapinghubClient","cause":"Incorrect import path; ScrapinghubClient is at the top-level package.","error":"ImportError: cannot import name 'ScrapinghubClient' from 'scrapinghub.client'"},{"fix":"Verify SH_APIKEY environment variable is set correctly and that you have internet access.","cause":"Often due to invalid API key or network issues.","error":"ScrapinghubError: ('Connection error: ...')"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}