Skip to content
APIAPI reference

Accounts

Your own accounts on the sites some operations need: connect, list, read, remove.

Connect an account

POSThttps://api.lobstr.io/v2/accounts

Connect one of your accounts on a site, from the cookies of a browser logged in to it. The site checks them at once; the account is kept only once it accepted them.

Body
site"leboncoin" | "x"required
cookiesobject | object[]required
The site's cookies from a browser where you are logged in: {name: value}, or a cookie editor's export (a list of {name, value, domain}).
countrystring
The country you use the account from (FR, US). Left out, the country of the IP this call comes from: right from your browser, wrong from a server elsewhere, where you say it. A site of one country sets its own.
Answer 201 or 200

201: The account, connected. 200: The same login connected again: its session replaced, its id kept.

object"account"required
idstringrequired
acc_...
site"leboncoin" | "x"required
namestringrequired
The login as the site shows it.
status"ok" | "paused" | "expired"required
ok: ready. paused: the site slowed it down; it comes back by itself at paused_until. expired: the site logged it out; connect it again.
countrystring | null
ISO 3166-1 alpha-2: its calls go out from an IP of this country and no other. Null for a site of one country, which sets it.
paused_untilstring | null
created_atstring
last_used_atstring | null

Anything else answers an error.

curl -X POST https://api.lobstr.io/v2/accounts \
  -H "Authorization: Bearer $LOBSTR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "site": "x",
    "cookies": {
      "auth_token": "...",
      "ct0": "..."
    },
    "country": "FR"
  }'

List your accounts

GEThttps://api.lobstr.io/v2/accounts

Your connected accounts.

Parameters
sitestringquery
Only this site's accounts.
Answer 200
object"list"required
has_morebooleanrequired
dataAccount[]required

Anything else answers an error.

curl https://api.lobstr.io/v2/accounts \
  -H "Authorization: Bearer $LOBSTR_API_KEY"

Read an account

GEThttps://api.lobstr.io/v2/accounts/{account_id}

One of your connected accounts.

Parameters
account_idstringpathrequired
Answer 200
object"account"required
idstringrequired
acc_...
site"leboncoin" | "x"required
namestringrequired
The login as the site shows it.
status"ok" | "paused" | "expired"required
ok: ready. paused: the site slowed it down; it comes back by itself at paused_until. expired: the site logged it out; connect it again.
countrystring | null
ISO 3166-1 alpha-2: its calls go out from an IP of this country and no other. Null for a site of one country, which sets it.
paused_untilstring | null
created_atstring
last_used_atstring | null

Anything else answers an error.

curl https://api.lobstr.io/v2/accounts/acc_7Hq2Kd9mX4pL \
  -H "Authorization: Bearer $LOBSTR_API_KEY"

Remove an account

DELETEhttps://api.lobstr.io/v2/accounts/{account_id}

Remove one of your accounts, its session with it.

Parameters
account_idstringpathrequired
Answer 200
object"account"required
idstringrequired
deletedtruerequired

Anything else answers an error.

curl -X DELETE https://api.lobstr.io/v2/accounts/acc_7Hq2Kd9mX4pL \
  -H "Authorization: Bearer $LOBSTR_API_KEY"