{"id":21611213,"url":"https://github.com/crocofactory/adspower","last_synced_at":"2025-05-10T20:10:26.227Z","repository":{"id":212316046,"uuid":"714258218","full_name":"CrocoFactory/adspower","owner":"CrocoFactory","description":"The package for interacting with anti-detect browser AdsPower API","archived":false,"fork":false,"pushed_at":"2024-09-29T21:00:42.000Z","size":105,"stargazers_count":46,"open_issues_count":6,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-10T09:51:05.971Z","etag":null,"topics":["adspower","adspower-api","adspower-automation","adspower-browser","antidetect","antidetect-browser","api","playwright","playwright-python","python","python3","selenium","selenium-python","selenium-webdriver"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/adspower/","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/CrocoFactory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-04T11:37:05.000Z","updated_at":"2025-04-20T21:01:41.000Z","dependencies_parsed_at":"2023-12-13T16:51:14.976Z","dependency_job_id":"cf324d37-d2c1-4d36-bd33-56529dc743ed","html_url":"https://github.com/CrocoFactory/adspower","commit_stats":null,"previous_names":["blnkoff/adspower","crocofactory/adspower"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrocoFactory%2Fadspower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrocoFactory%2Fadspower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrocoFactory%2Fadspower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrocoFactory%2Fadspower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrocoFactory","download_url":"https://codeload.github.com/CrocoFactory/adspower/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253474228,"owners_count":21914230,"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":["adspower","adspower-api","adspower-automation","adspower-browser","antidetect","antidetect-browser","api","playwright","playwright-python","python","python3","selenium","selenium-python","selenium-webdriver"],"created_at":"2024-11-24T21:11:28.448Z","updated_at":"2025-05-10T20:10:26.205Z","avatar_url":"https://github.com/CrocoFactory.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# adspower\n                     \n\u003ca href=\"https://www.adspower.com\"\u003e\u003ch1 align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/CrocoFactory/adspower/main/branding/adspower/banner.png\" width=\"300\" style=\"border-radius:7px;\"\u003e\u003c/h1\u003e\u003cbr\u003e\u003c/a\u003e\n\n[![Python versions](https://img.shields.io/pypi/pyversions/adspower?color=%231D4DFF)](https://pypi.org/project/adspower/)\n[![PyPi Version](https://img.shields.io/pypi/v/adspower?color=%231D4DFF)](https://pypi.org/project/adspower/)\n\n\nThe package for interacting with API of anti-detect browser [AdsPower](https://www.adspower.com).\n\n- **[Overview](#quick-start)**\n- **[Installing](#installing-adspower)**\n- **[Bug reports](https://github.com/CrocoFactory/adspower/issues)**\n\nThe project is made by the **[Croco Factory](https://github.com/CrocoFactory)** team\n\nadspower's source code is made available under the [MIT License](LICENSE)\n         \n## Features\n- Synchronous and asynchronous interaction with the local API\n- Interaction with the most popular libraries for browser automation in Python: Selenium and Playwright\n\n## Restrictions\n1. During using the package, AdsPower must be opened. \n2. The local API is available only in paid AdsPower subscriptions\n3. AdsPower has frequency control for all APIs, max. access frequency: 1 request/second \n\n\n## Quick start\n\n*Example of interacting with synchronous API.*\n\n```python\nfrom adspower.sync_api import Group, ProfileAPI\ngroup = Group.create(name='my_group', remark='The best group ever')\n\nprofile_api = ProfileAPI.create(group=group)  \nprint(f'Profile {profile_api.name} was created in group {group.name}')\n```\n\n**Use `ProfileAPI` only when** you don't need `Selenium` and `Playwright` interactions.\n\nLibrary provides ways to interact the most popular libraries for browser automation in Python: `Selenium` and `Playwright`.\nTo get a browser, you can use `with` statement:\n\n- *Selenium*\n\n```python\nfrom adspower.sync_api.selenium import Profile, Group\nmy_group = Group.query(name='my_group')[0]\nprofile = Profile.create(group=my_group, name='my_profile')\n\nwith profile as browser:\n   browser.get('https://github.com/blnkoff/adspower')\n```\n\n- *Playwright*\n\n```python\nfrom adspower.async_api.playwright import Profile, Group\n\nasync def main() -\u003e None:\n    my_group = (await Group.query(name='my_group'))[0]\n    profile = await Profile.create(group=my_group, name='my_profile')\n    \n    async with profile as browser:\n       page = browser.pages[0]\n       await page.goto('https://github.com/blnkoff/adspower')\n```\n\nBoth versions support sync and async API.\n\nOr manually call `get_browser` if you need specify part of behaviour.\n```python\nfrom adspower.sync_api.selenium import Profile, Group\n\nmy_group = Group.query(name='my_group')[0]\nprofile = Profile.create(group=my_group, name='my_profile')\nbrowser = profile.get_browser(ip_tab=False, headless=True, disable_password_filling=True)\nbrowser.get('https://github.com/blnkoff/adspower')\nprofile.quit()\n```\n\nNotice that you must not call quitting methods of `Playwright` library or `Selenium` after `profile.quit()`, since \nit calls these methods automatically. An attempt to do so will lead to the error.\n           \n*Example of setting proxy and fingerprint*\n\n```python\nfrom adspower.sync_api.playwright import Profile, Group\nfrom adspower import ProxyConfig, FingerprintConfig\n\nproxy = ProxyConfig(\n    soft='other',\n    type='http',\n    host='xx.xx.x.xx',\n    port=1000,\n    user='username',\n    password='password'\n)\n\nfingerprint = FingerprintConfig(\n    ua='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.112 Safari/537.36'\n)\n\ngroup = Group.query(name='my_group')[0]\nprofile = Profile.create(group=group, proxy_config=proxy, name='my_profile', fingerprint_config=fingerprint)\n```\n\nThere are extension categories, implemented as `Category` class. At the moment, it can`t be created, but can be retrieved.\nYou can manually create extension category and used it for profile creation using API.\n  \n*Example of querying category* \n\n```python\nfrom adspower.sync_api.playwright import Profile, Category, Group\n\ncategory = Category.query(name='my_category')[0]\ngroup = Group.query(name='my_group')[0]\n\nprofile = Profile.create(group=group, category=category)\n```\n\nYou can create anonymous profile that is deleted after last statement in context manager.\n   \n*Example of anonymous profile*\n```python\nfrom adspower.async_api.playwright import Profile, Group\n\nasync def main() -\u003e None:\n    my_group = (await Group.query(name='my_group'))[0]\n    profile = await Profile.anonymous(group=my_group)\n\n    async with profile as browser:\n        page = browser.pages[0]\n        await page.goto('https://www.google.com')\n```\n\nEach API entity, such as Profile, Group and Category, pretty formatted, can be compared and converted to dict\n     \n*Example 1*\n\n```python\nfrom adspower.sync_api.playwright import Category\n\ncategory = Category.query(name='my_category')[0]\nprint(category) \n```\n\n```markdown\nCategory(id=10515; name=my_category)\n```\n  \n*Example 2*\n\n```python\nfrom adspower.sync_api.playwright import Profile, Group\n\ngroup = Group.query(name='my_group')[0]\nprofile_created = Profile.create(group=group)\n\nprofile_queried = Profile.query(id_=profile_created.id)\nprint(profile_queried == profile_created)\n```\n\n```python\nTrue\n```\n\n*Example 3*\n```python\nfrom adspower.sync_api.playwright import Category\n\ncategory = Category.query(name='my_category')[0]\nprint(category.to_dict())\n```\n\n```json\n{\n    \"id\": 10515, \n    \"name\": \"my_category\", \n    \"remark\": \"category remark\"\n}\n```\n\n# Installing adspower\nTo install the package from PyPi you can use that:\n\n```sh\npip install adspower\n```\n\nYou will probably want to use the pacakge with `Selenium` or `Playwright`. You can install it as extra-package:\n\n```sh\npip install adspower[playwright]\n```\n\n```sh\npip install adspower[selenium]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrocofactory%2Fadspower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrocofactory%2Fadspower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrocofactory%2Fadspower/lists"}