{"id":22674743,"url":"https://github.com/bitnom/actproxy","last_synced_at":"2025-03-29T12:22:09.232Z","repository":{"id":62559769,"uuid":"299172041","full_name":"bitnom/actproxy","owner":"bitnom","description":"Sync \u0026 asyncio (Requests \u0026 AIOHTTP) proxy rotator + utils for actproxy API \u0026 services.","archived":false,"fork":false,"pushed_at":"2020-11-09T11:13:45.000Z","size":145,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T21:51:16.995Z","etag":null,"topics":["aiohttp","proxies","proxy","python","python3","requests","socks","socks5"],"latest_commit_sha":null,"homepage":"","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/bitnom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-28T03:02:40.000Z","updated_at":"2023-04-03T09:34:00.000Z","dependencies_parsed_at":"2022-11-03T12:45:26.087Z","dependency_job_id":null,"html_url":"https://github.com/bitnom/actproxy","commit_stats":null,"previous_names":["tensortom/actproxy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Factproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Factproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Factproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Factproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitnom","download_url":"https://codeload.github.com/bitnom/actproxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246181808,"owners_count":20736620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aiohttp","proxies","proxy","python","python3","requests","socks","socks5"],"created_at":"2024-12-09T17:17:59.628Z","updated_at":"2025-03-29T12:22:09.208Z","avatar_url":"https://github.com/bitnom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# actproxy\n\nPython package providing [actproxy.com](https://actproxy.com/aff.php?aff=30) API access and proxy rotation methods for requests (synchronous) and aiohttp\n(asyncio). Can also be used independently. Supports socks5, http/https, and ipv4/ipv6 as per actproxy's services.\n\n[![PyPI license](https://img.shields.io/pypi/l/ansicolortags.svg)](https://pypi.org/project/actproxy/)\n\n## Quick-Start (AIOHTTP)\n\n```python\nimport actproxy\nfrom aiohttp import ClientSession\n\n\nasync def main():\n    actproxy_api_keys = [\n        \"xxxxxxxxxxxxxxxxxxxxxxxx\",\n        \"xxxxxxxxxxxxxxxxxxxxxxxx\"\n    ]\n    # Initialize API. Also returns your proxies.\n    await actproxy.aioinit(actproxy_api_keys)\n    # Use a new AIOHTTP connector which rotates \u0026 uses the next proxy.\n    async with ClientSession(connector=actproxy.aiohttp_rotate()) as session:\n        url = \"http://dummy.restapiexample.com/api/v1/employees\"\n        async with session.get(url) as resp:\n            if resp.status == 200:\n                resp_json = await resp.json()\n                print(resp_json)\n```\n\n## Quick-Start (Requests)\n\n```python\nimport actproxy\nimport requests\n\nactproxy_api_keys = [\n    \"xxxxxxxxxxxxxxxxxxxxxxxx\",\n    \"xxxxxxxxxxxxxxxxxxxxxxxx\"\n]\n# Initialize API. Also returns your proxies.\nactproxy.init(actproxy_api_keys)\nurl = \"http://dummy.restapiexample.com/api/v1/employees\"\nresp = requests.get(url, proxies=actproxy.rotate())\nif resp.status_code == 200:\n    resp_json = resp.json()\n    print(resp_json)\n```\n\n## Methods\n\n```python\nactproxy.aioinit(api_keys: List = None, output_format: DumpFormat = 'json', get_userpass: Boolean = True) -\u003e Union[FlatList, str, None]\n```\n\nFetches your proxies from ActProxy \u0026 returns them. Must be run before the other aiohttp\nfunctions.\n\n```python\nactproxy.init(api_keys: List[str], output_format: DumpFormat = 'json', get_userpass: Any = True) -\u003e Union[FlatList, str, None]\n```\n\nFetches your proxies from ActProxy \u0026 returns\nthem. Must be run before the other synchronous functions.\n\n```python\nactproxy.aiohttp_rotate(protocol: ProxyProto/str, return_proxy: Boolean = False) -\u003e Union[ProxyConnector, Tuple[Data, ProxyConnector]]\n```\n\nReturns an aiohttp connector which uses the next proxy from your list.\n\n```python\nactproxy.async_rotate_fetch(url: str, protocol: ProxyProto/str = 'socks5', return_proxy: Boolean = False) -\u003e Data\n```\n\nRotate proxies and perform a GET request. Returns a Data object of `response.status_code`, `response.text`, and\n`response.headers`.\n\n```python\nactproxy.rotate(protocol: ProxyProto = 'socks5') -\u003e Data\n```\nReturns the next proxy from your list. Return variable is suitable for use with requests[socks].\n\n```python\nactproxy.random_proxy(protocol: ProxyProto = 'socks5') -\u003e Data\n```\n\nReturns a random proxy from your list. Return variable is suitable for use with\nrequests[socks].\n\n```python\nactproxy.aiohttp_random(protocol: ProxyProto = 'socks5', return_proxy: Boolean = False) -\u003e Union[ProxyConnector, Tuple[Data, ProxyConnector]]\n```\n\nReturns an aiohttp connector which uses uses a random proxy from your list.\n\n```python\nactproxy.one_hot_proxy() -\u003e Data\n```\n\nSimilar to rotate() but returns a single proxy dict/object for use in places other than\naiohttp or requests.\n\n## Changelog\n\n**0.1.9** - _11/09/2020_ : New asyncio rotation methods based on python_socks.\n\n**0.1.8** - _10/28/2020_ : Fixed versioning typo.\n\n**0.1.7** - _10/28/2020_ : Relax Python version constraint (3.8-4.0).\n\n**0.1.6** - _10/24/2020_ : Lock aiohttp version fixing [aiohttp #5112](https://github.com/aio-libs/aiohttp/issues/5112)\n\n**0.1.5** - _10/24/2020_ : Rotator bug fix. CSV fix. Better type-hints \u0026 coverage.\n\n**0.1.4** - _10/23/2020_ : Support multiple API keys. Unit tests. Fixes.\n\n**0.1.3** - _9/29/2020_ : Minor fixes and addition of docstrings.\n\n**0.1.2** - _9/28/2020_ : Initial release version.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitnom%2Factproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitnom%2Factproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitnom%2Factproxy/lists"}