AdsPower Local API and Headless Browsing

Status
Not open for further replies.

AdsPower

Member
17
2021
1
1,600

AdsPower Local API and Headless Browsing

AdsPower provides Local API for all subscriptions now. You can run AdsPower in headless mode with the help of the “headless” parameter and API keys. Use of Local API is also allowed in this case.

* This feature is only available for users who have access to Local API. Please contact online client service if needed.


What is “headless” and API key?

· “headless”: a parameter used to run AdsPower in headless mode

· API key: an API key is a unique identifier used by Local APIs as authentification in headless mode. Each account has its own API key, which can be used to allow the use of Local APIs on multiple devices by one account.


How to run in headless mode?

1. Get the API key.

1) Open AdsPower Client, go to “Account Management -> Settings”.
3xT1bDpfZMmHyE4.png


2) Click “Generate api-key” under “Local API”.
YeFxdAWXEmzK6B3.png


3) Copy the API key.
k9TtbXP1N3Fwdji.png



2. Run AdsPower in headless mode using the command line and API keys.

1) Make sure you have opened CMD or Terminal in the folder of AdsPower.

* The folder’s path is usually “C:\Program Files (x86)\AdsPower” on Windows.


2) Execute the command line: paste the API key copied from AdsPower Client in the command line.​

Parameter​
Requiered​
Description​
--headless​
Yes​
When the value is “true”, it’s used to start the headless mode​
--api-key​
Yes​
Identifier used by Local APIs as authentification in headless mode​
--api-port​
No​
The service enpoint of Local APIs​
*Parameters for Windows / Mac:​

Windows: AdsPower.exe --headless=true --api-key=XXXX --api-port=50325

MacOS: /Applications/adsPower.app/Contents/MacOS/Adspower --args --headless=true --api-key=XXXX --api-port=50325

When the execution is succeeded, you can see the address to which the Local API returns as below:
6SV3NOJxP1olzRw.png


Non-headless vs headless

In non-headless mode, the login to an account is restricted to one device, while in headless mode, the login to an account from multiple devices is allowed.

If you want to run automated operations using one account on multiple devices, you can use Local APIs in headless mode with the help of API keys.


FAQ

Q: Can I run the software in non-headless mode and in headless mode simultaneously?

A: No.


Q: If the API key has been changed, can I still use the API, which was authentificated by the old API key?

A: No, the system will warn you about the invalid API key. Currently an account has only one API key. So if you reset the API key, the old one will become invalid.


Q: How to reset the API key?

A: Go to “Account Management->Settings”, click “Genereate api-key” to get a new one.


Q: If the API key has been changed, can I update it in headless mode?

A: No. You have to turn off the headless mode and use it with the new API key.


Q: How to tun off the headless mode?

A: You can use “ctrl+c” or simply close the command line window.
 
Status
Not open for further replies.
Back
Top