0detect Tutorials

14. 0DETECT browser API automation or creating your own bots

API 0DETECT is a convenient tool for developers and specialists who want to control the browser not manually, but through a ready-made software interface. With its help, you can launch profiles with the necessary settings, connect to already running sessions, switch proxies, add or delete profiles in bulk, manage cookies, and launch a Cookies Robot for background website crawling. Essentially, this is an opportunity to build your own automation system, where browser actions are performed not by a person, but by your code. The API works in conjunction with popular libraries such as Selenium and Puppeteer, so it can be easily integrated into existing processes.

How to enable Local API

To get started, simply activate Local API in the dashboard settings. The system will then generate three key elements: an API token for authorization, the port number through which the connection is made, and, when using Selenium, the path to chromedriver.

If you update the token or change the port, you will need to restart the Local API. This is important, otherwise the scripts will not be able to connect. When starting a profile, pay attention to the devtools_port parameter. It can change with each start, so you need to provide for handling this situation in the code. 

Features and usage scenarios

The API allows you to work with profiles at different levels: create new ones with the necessary parameters, get a list of existing ones, start or stop them. For convenience, you can use tags, which help you quickly find the profile you need among dozens or hundreds of others. Another important feature is cookie management. You can upload your own cookies, export them from profiles, or use the built-in Cookies Robot. This tool automatically visits websites and updates sessions, which is especially useful for projects where regular account activity is important. The robot can also work in headless mode, i.e., without a visual interface, in the background. 

Restrictions and pricing

Not all plans include access to Local API. Before building your integration, check whether this feature is supported in your subscription. It is also important to note that some parameters may vary depending on the plan, so it is best to check the settings against the documentation.

Make your work fast and secure with 0DETECT Browser

Want to stay up to date with all news, discounts, promotions? Sign up for our newsletter and be the first to receive the latest information
Follow us on Social Media
Explore 0DETECT Browser