SurSolver

How to solve Akamai

Akamai protects sites at the edge and hands out cookies that unlock the protected requests. Here is how to recognise it and replay a solve correctly.

Updated

$0.30 / 1K tasksCharged when a task is accepted

On this page

What is Akamai Bot Manager and how to recognise it

Akamai Bot Manager is an edge layer that scores every request to a protected site. An obfuscated same-origin script collects browser and device signals and posts them back to the edge, which then decides whether to allow, limit, challenge or block the traffic. You can recognise it from the response cookies: _abck and bm_sz are the usual pair, often together with ak_bmsc. Response headers such as X-Akamai-Transformed or an akamai-grn marker point at the same edge, and the script that collects the signals is served from a random-looking first-party path that changes between loads.

The Akamai cookies (including _abck and bm_sz) a real browser session holds on singaporeair.com, listed via the console

Unlike a widget that sits in a form, this protection has no visible challenge to look for. The page loads, and the cookies in the response carry the state that decides what you are allowed to do next. Protected actions — login, checkout, a product API call — are where a weak or missing state shows up, often as a block page or a repeated challenge rather than a form.

The result contains the validated cookie as _abck, not token. Optional cookies maps each returned cookie name to its value. Replay with the userAgent you supplied in the task; it is not returned again.

Which page URL and sensor scripts to send

Start from the page whose first load serves the sensor — normally the login, checkout or product page, not the homepage. Send that full URL, including its path and query string.

Confirm the site runs Akamai Bot Manager before you send anything: look at the response cookies for _abck and bm_sz, and at the HTML for that script. Send the User-Agent of the client that will replay the cookies as the required userAgent, and replay with exactly that value.

Send the full script URLs as the required scriptUrls array, copied from the page source or Network tab. Use an array even for one script. Optional pageData is the HTML of the protected page as you received it and supplies its sensor seed; it does not replace scriptUrls.

Akamai serves two different script setups, and webSensor picks the one the task runs:

Page loads webSensor scriptUrls order Also send
The /akam/13/… pixel and the sensor script false (default, can be left out) Send both URLs; no sensor-first requirement —
Akamai's web sensor script, which posts sensor_data to its own path true Sensor first, then the pixel and any async script. The solver loads the others after the first sensor POST cookies from the page response, including _abck and any bm_sz or ak_bmsc cookies it set

With webSensor: true, scriptUrls[0] must be the sensor script. Only POSTs to that script's path count toward completion: at least two responses must have status 200 or 201 and "success": true in the body. The task can also finish early if _abck reaches ~0~. Optional verify is a protected path on the same site, such as /api/account, that must answer 2xx within four seconds after the solve; it is accepted only with webSensor: true.

Capture session cookies after loading the page's scripts. _abck may first be set by the sensor script response, rather than the initial page response.

A short interstitial that sets bm_s, bm_sc and bm_so before the real page is a different flow. Use the Akamai SBSD guide for its interstitial inputs and proxy requirements. For Android x-acf-sensor-data headers, use Akamai BMP.

Check which mode the site uses

  1. Open the protected page in a new incognito window so the session starts without old cookies.
  2. Open F12 → Console and run this command to read the _abck status:
solve.js
document.cookie.match(/(?:^|;\s*)_abck=([^;]+)/)?.[1]?.split('~')[1]
  1. Move the mouse around the page for 10–15 seconds, run the command again, and check Network for POSTs to the sensor script's path.
What you observe What to do
The status changes from -1 to 0 Use normal mode; omit webSensor (defaults to false).
The status stays at -1 and sensor POSTs return 201 Use webSensor: true.
The status stays at -1 and sensor POSTs are missing or fail Check whether the sensor loaded and whether the IP is blocked before choosing a mode.

If the command returns undefined, the page has no script-visible _abck cookie yet. Check the page response and sensor loading first; -1 alone is not enough to select web sensor mode.

Where the cookies go

Set every entry of cookies (a name-to-value object) on the protected site's domain with path /, on a session that uses the task's userAgent. Then request the protected page or API from that session.

Protected actions can invalidate the state, so when a request is challenged again, solve again rather than reusing an old result.

In normal mode, a successful solve flips the status segment of _abck to 0. With webSensor: true, the task can finish after Akamai accepts the sensor posts while _abck still contains ~-1~. Check the returned cookies against the protected request you actually need; sensor acceptance alone does not guarantee that every application action will be allowed.

Common mistakes

Do not mix cookies from one solve with a different user agent. Keep the returned cookies and browser identity together, and do not treat an old cookie value as a long-lived application credential.

Check the protection type before selecting a task. _abck sensor generation, SBSD interstitials and Android BMP headers have different inputs and replay rules.

Solve it with SurSolver

Send the protected page URL, scriptUrls and your userAgent to createTask with AkamaiCookie or AkamaiCookieProxyLess; add webSensor: true and the page's cookies when the page runs the web sensor script. Poll getTaskResult until the status is ready, then replay the cookies with that same user agent. The Akamai API reference contains both request examples and the result shape.

The official client wraps createTask and polling in one solve call; each language tab is its Quick start with this captcha's request, and prints _abck. Turn the returned cookies into a Cookie header for the protected URL and send it with the task's user agent. The Playwright tab runs the same flow in a browser session. The Akamai solver guide covers the full integration, including browser sessions.

quickstart.ts
npm install sursolver
import { SurSolver, TaskType } from 'sursolver';

const API_KEY = 'YOUR_API_KEY';
const USER_AGENT =
  'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36';

const client = new SurSolver(API_KEY);

const { solution } = await client.solve({
  type: TaskType.AkamaiCookieProxyLess,
  websiteURL: 'https://example.com/login',
  scriptUrls: ['https://example.com/akam/13/1a2b3c4d', 'https://example.com/aB3dE5fG7h/kL1mN3pQ5r'],
  userAgent: USER_AGENT,
});
console.log(solution._abck);

FAQ

What does an Akamai task return?

solution._abck contains the validated _abck cookie. solution.cookies is an optional object of all returned cookie names and values, including bm_sz and ak_bmsc when present.

Do I need a proxy?

No. AkamaiCookie and AkamaiCookieProxyLess run without your proxy, and a supplied proxy is not used. Replay the returned _abck from your IP with the userAgent you sent in the task. SBSD is a separate, proxy-required flow.

How long can I use the result?

Trust lasts from a few protected requests to a few hours, even though the cookie itself carries an expiry of about a year. Replay promptly, and solve again when the site challenges a request instead of reusing an old result.

When do I send webSensor: true?

When the page runs Akamai's web sensor script, the one that posts sensor_data to its own path. Leave it out (false) for the classic /akam/13/ pixel and sensor scripts. With true, cookies with the page's _abck are required.

In which order do I list scriptUrls?

With webSensor: false, send the pixel and sensor URLs; no sensor-first order is required. With true, put the sensor first, followed by the pixel and any async script. The solver loads those other scripts after the first sensor POST.