Menu

API

Local API allows users to read and write configuration information, start and close the browser, search for account and so on. To know more details, please click here to get Local API documentation.

Click here to check how to troubleshoot common issues with API.

How to Use AdsPower Local API

The super admins have access to API by default. If you are a team member, please make sure your manager or admin has assigned you this permission.

文章图片


Go to Automation -> API to check the API connection status.

文章图片


AdsPower Local API list

文章图片


How to Use API-key and Headless

AdsPower allows to start headless mode with headless and API-key

Before starting, please make sure that the AdsPower version is v3.3.2 or above, kernel version is v2.4.2.8 or above and you have access to Local API.
  • headless: A parameter to start headless mode
  • API-key: Credential to use Local API in headless service. It allows to control Local API on multiple devices with one account at the same time. Each team member has a unique API key.


Get API key

Click Generate or Reset to get your API key.

文章图片


Start in headless mode

1. Make sure that you have opened CMD or Terminal in your AdsPower root directory.

The root directory in Windows is usually “C:\Program Files (x86)\AdsPower”.


2. Start command

flagrequired or optionaldescription
--headlessrequiredRuns browser in headless mode.
--api-keyrequiredCredential to use Local API in headless mode
--api-portoptionalSpecified port for Local API


On Windows:

"AdsPower Global.exe" --headless=true --api-key=XXXX --api-port=50325

On macOS:

"/Applications/AdsPower Global.app/Contents/MacOS/AdsPower Global" --args --headless=true --api-key=XXXX --api-port=50325

On Linux:

adspower_global --headless=true --api-key=XXX --api-port=50325


3. Now you can see return address in CLI.

文章图片


FAQ

❓Is it possible to start GUI mode and headless mode on a device at the same time?

No.


❓If API key is reset, will the original API still work?

No. When resetting your API key, The previous API key is invalidated. You will need to reconnect to your new API key to ensure everything is functioning as expected.


❓If API key is reset, is it possible to update it when service is running?

No. You should stop service first and use the new API key to start it again.


❓How to stop service?

By pressing Ctrl+C (under CMD) or exiting the Windows command line window.


❓What is the difference between headless mode and GUI?

1. In GUI mode you are able to log in to one account on only one device.

2. Using API-key you can log in to accounts on multiple devices at the same time. It allows you to execute automation on multiple devices for one AdsPowe account.


❓How to troubleshoot errors?

FYR here are our demos for API: https://github.com/AdsPower/localAPI


For more FAQ, please check this article on our official website.

https://www.adspower.com/blog/troubleshooting-common-issues-with-adspower-api-a-complete-guide

Previous
RPA
Next
👩‍💻Team
Last modified: 2024-07-24Powered by