{"id":37747850,"url":"https://github.com/promptapi/scraper-py","last_synced_at":"2026-01-16T14:18:50.117Z","repository":{"id":57450932,"uuid":"291798945","full_name":"promptapi/scraper-py","owner":"promptapi","description":"Python package for Prompt API's Scraper API","archived":false,"fork":false,"pushed_at":"2020-10-06T04:45:46.000Z","size":57,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-20T00:56:50.189Z","etag":null,"topics":["api-marketplace","api-wrapper","css-selector","css-selector-parser","data-extraction","image-scraper","promptapi","python3","scraper","scraper-api","web-scraper","web-scraping"],"latest_commit_sha":null,"homepage":"https://promptapi.com/marketplace/description/scraper-api","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/promptapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-31T18:54:12.000Z","updated_at":"2022-10-07T08:34:48.000Z","dependencies_parsed_at":"2022-09-10T03:32:57.858Z","dependency_job_id":null,"html_url":"https://github.com/promptapi/scraper-py","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/promptapi/scraper-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/promptapi%2Fscraper-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/promptapi%2Fscraper-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/promptapi%2Fscraper-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/promptapi%2Fscraper-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/promptapi","download_url":"https://codeload.github.com/promptapi/scraper-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/promptapi%2Fscraper-py/sbom","scorecard":{"id":746919,"data":{"date":"2025-08-11","repo":{"name":"github.com/promptapi/scraper-py","commit":"d47c5c1cdc6a01084ab5659a3219a5a652792053"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENCE:0","Info: FSF or OSI recognized license: MIT License: LICENCE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T19:05:44.772Z","repository_id":57450932,"created_at":"2025-08-22T19:05:44.773Z","updated_at":"2025-08-22T19:05:44.773Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-marketplace","api-wrapper","css-selector","css-selector-parser","data-extraction","image-scraper","promptapi","python3","scraper","scraper-api","web-scraper","web-scraping"],"created_at":"2026-01-16T14:18:48.279Z","updated_at":"2026-01-16T14:18:50.107Z","avatar_url":"https://github.com/promptapi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Python](https://img.shields.io/badge/python-3.7.4-green.svg)\n![Version](https://img.shields.io/badge/version-0.2.4-orange.svg)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Build Status](https://travis-ci.org/promptapi/scraper-py.svg?branch=main)](https://travis-ci.org/promptapi/scraper-py)\n\n# Prompt API - Scraper API - Python Package\n\n`pa-scraper` is a python wrapper for [scraper api][scraper-api] with few\nmore extra cream and sugar.\n\n## Requirements\n\n1. You need to signup for [Prompt API][promptapi-signup]\n1. You need to subscribe [scraper api][scraper-api], test drive is **free!!!**\n1. You need to set `PROMPTAPI_TOKEN` environment variable after subscription.\n\nthen;\n\n```bash\n$ pip install pa-scraper\n```\n\n---\n\n## Example Usage\n\nExamples can be found [here][examples].\n\n```python\n# examples/fetch.py\n\nfrom scraper import Scraper\n\nurl = 'https://pypi.org/classifiers/'\nscraper = Scraper(url)\nresponse = scraper.get()\n\nif response.get('error', None):\n    # response['error']  returns error message\n    # response['status'] returns http status code\n\n    # Example: {'error': 'Not Found', 'status': 404}\n    print(response)  # noqa: T001\nelse:\n    data = response['result']['data']\n    headers = response['result']['headers']\n    url = response['result']['url']\n    status = response['status']\n\n    # print(data) # print fetched html, will be long :)\n\n    print(headers)  # noqa: T001\n    # {'Content-Length': '321322', 'Content-Type': 'text/html; charset=UTF-8', ... }\n\n    print(status)  # noqa: T001\n    # 200\n\n    save_result = scraper.save('/tmp/my-data.html')  # noqa: S108\n\n    if save_result.get('error', None):\n        # save error occured...\n        # add you code here...\n        pass\n\n    print(save_result)  # noqa: T001\n    # {'file': '/tmp/my-data.html', 'size': 321322}\n\n```\n\nYou can add url parameters for extra operations. Valid parameters are:\n\n- `auth_password`: for HTTP Realm auth password\n- `auth_username`: for HTTP Realm auth username\n- `cookie`: URL Encoded cookie header.\n- `country`: 2 character country code. If you wish to scrape from an IP address of a specific country.\n- `referer`: HTTP referer header\n- `selector`: CSS style selector path such as `a.btn div li`. If `selector`\n  is enabled, returning result will be collection of data and saved file\n  will be in `.json` format.\n\nHere is an example with using url parameters and `selector`:\n\n```python\n# examples/fetch_with_params.py\n\nfrom scraper import Scraper\n\nurl = 'https://pypi.org/classifiers/'\nscraper = Scraper(url)\n\nfetch_params = dict(country='EE', selector='ul li button[data-clipboard-text]')\nresponse = scraper.get(params=fetch_params)\n\nif response.get('error', None):\n    # response['error']  returns error message\n    # response['status'] returns http status code\n\n    # Example: {'error': 'Not Found', 'status': 404}\n    print(response)  # noqa: T001\nelse:\n    data = response['result']['data']\n    headers = response['result']['headers']\n    url = response['result']['url']\n    status = response['status']\n\n    # print(data)  # noqa: T001\n    # ['\u003cbutton class=\"button button--small margin-top margin-bottom copy-tooltip copy-tooltip-w\" ...\\n', ]\n\n    print(len(data))  # noqa: T001\n    # 734\n    # we have an array...\n\n    print(headers)  # noqa: T001\n    # {'Content-Length': '321322', 'Content-Type': 'text/html; charset=UTF-8', ... }\n\n    print(status)  # noqa: T001\n    # 200\n\n    save_result = scraper.save('/tmp/my-data.json')  # noqa: S108\n    if save_result.get('error', None):\n        # save error occured...\n        # add you code here...\n        pass\n    print(save_result)  # noqa: T001\n    # {'file': '/tmp/my-data.json', 'size': 174449}\n\n```\n\nDefault **timeout** value is set to `10` seconds. You can change this while\ninitializing the instance:\n\n```python\nscraper = Scraper(url, timeout=50)  # 50 seconds timeout...\n```\n\nYou can also add custom headers prefixed with `X-`. Example below shows\nhow to add extra request headers and set default timeout:\n\n```python\n# pylint: disable=C0103\nfrom scraper import Scraper\n\nif __name__ == '__main__':\n\n    url = 'https://pypi.org/classifiers/'\n    scraper = Scraper(url)\n\n    fetch_params = dict(country='EE', selector='ul li button[data-clipboard-text]')\n    custom_headers = {\n        'X-Referer': 'https://www.google.com',\n        'X-User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0',\n    }\n    timeout = 30\n    response = scraper.get(params=fetch_params, headers=custom_headers, timeout=timeout)\n\n    if response.get('error', None):\n        # response['error']  returns error message\n        # response['status'] returns http status code\n\n        # Example: {'error': 'Not Found', 'status': 404}\n        print(response)  # noqa: T001\n    else:\n        data = response['result']['data']\n        headers = response['result']['headers']\n        url = response['result']['url']\n        status = response['status']\n\n        # print(data)  # noqa: T001\n        # ['\u003cbutton class=\"button button--small margin-top margin-bottom copy-tooltip copy-tooltip-w\" ...\\n', ]\n\n        print(len(data))  # noqa: T001\n        # 734\n\n        print(headers)  # noqa: T001\n        # {'Content-Length': '321322', 'Content-Type': 'text/html; charset=UTF-8', ... }\n\n        print(status)  # noqa: T001\n        # 200\n\n        save_result = scraper.save('/tmp/my-data.json')  # noqa: S108\n        if save_result.get('error', None):\n            # save error occured...\n            # add you code here...\n            pass\n        print(save_result)  # noqa: T001\n        # {'file': '/tmp/my-data.json', 'size': 174449}\n```\n\n\n---\n\n## License\n\nThis project is licensed under MIT\n\n---\n\n## Contributer(s)\n\n* [Prompt API](https://github.com/promptapi) - Creator, maintainer\n\n---\n\n## Contribute\n\nAll PR’s are welcome!\n\n1. `fork` (https://github.com/promptapi/scraper-py/fork)\n1. Create your `branch` (`git checkout -b my-feature`)\n1. `commit` yours (`git commit -am 'Add awesome features...'`)\n1. `push` your `branch` (`git push origin my-feature`)\n1. Than create a new **Pull Request**!\n\nThis project is intended to be a safe,\nwelcoming space for collaboration, and contributors are expected to adhere to\nthe [code of conduct][coc].\n\n---\n\n[scraper-api]:      https://promptapi.com/marketplace/description/scraper-api\n[promptapi-signup]: https://promptapi.com/#signup-form\n[coc]:              https://github.com/promptapi/scraper-py/blob/main/CODE_OF_CONDUCT.md\n[examples]:         https://github.com/promptapi/scraper-py/blob/main/examples/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpromptapi%2Fscraper-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpromptapi%2Fscraper-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpromptapi%2Fscraper-py/lists"}