Appearance
SDKs and examples
Both SDKs wrap the same API and return the same JSON as the API reference. They have no dependencies.
Node.js
Node.js 18 or newer.
bash
npm install aresloginjs
import { AresLogin, AresLoginError } from 'areslogin';
const ares = new AresLogin({ apiKey: process.env.ARES_API_KEY });
const profile = await ares.profiles.create({
name: 'shop-01',
proxy: 'http://user:pass@1.2.3.4:8080',
tags: ['shopee'],
});
try {
const run = await ares.profiles.start(profile.id);
console.log(run.cdp_url);
} catch (e) {
if (e instanceof AresLoginError) console.error(e.status, e.code, e.message);
}| Method | Does |
|---|---|
me() | Account, plan limits, usage |
devices() | Computers running the AresLogin app |
browsers({ device_id }) | Browser versions you can create profiles with |
groups(), proxies() | Groups and saved proxies |
profiles.list(query) | List with filters |
profiles.get(id), profiles.create(body), profiles.update(id, body), profiles.delete(id) | |
profiles.start(id, { device_id, timeout }) | Starts and waits until the browser is up |
profiles.stop(id), profiles.status(id), profiles.checkProxy(id) |
Python
Python 3.8 or newer.
bash
pip install aresloginpython
import os
from areslogin import AresLogin, AresLoginError
ares = AresLogin(api_key=os.environ["ARES_API_KEY"])
profile = ares.profiles.create("shop-01", proxy="http://user:pass@1.2.3.4:8080", tags=["shopee"])
try:
run = ares.profiles.start(profile["id"])
print(run["cdp_url"])
except AresLoginError as e:
print(e.status, e.code, e.message)Methods: me(), devices(), browsers(device_id=None), groups(), proxies(), and profiles.list / get / create / update / delete / start / stop / status / check_proxy.
What the SDKs do for you
- Wait for the browser.
profiles.startkeeps polling while the app downloads a browser core, and returns once the browser is up. - Retry when rate limited. A
429is retried after the time the API asks for. The latest limits are inares.rateLimit(Node) orares.rate_limit(Python). - Typed errors. Every failed call raises
AresLoginErrorwithstatus,codeandmessage. Codes are listed in the API reference.
Create many profiles from a proxy list
js
import fs from 'node:fs';
import { AresLogin } from 'areslogin';
const ares = new AresLogin({ apiKey: process.env.ARES_API_KEY });
const proxies = fs.readFileSync('proxies.txt', 'utf8').split(/\r?\n/).filter(Boolean);
for (const [i, proxy] of proxies.entries()) {
const p = await ares.profiles.create({ name: `shop-${i + 1}`, proxy, tags: ['bulk'] });
console.log('created', p.id, p.name);
}