SBSD Challenge Flow
Websites using Akamai's active SBSD mode serve a challenge that must be solved before content is released. This page walks through that challenge flow.
Understanding SBSD Protection
State Based Scraping Detection (SBSD) is an advanced bot protection mechanism used by Akamai to protect websites from scrapers. Websites protected by SBSD present a challenge that must be solved before allowing access to the protected content. Our Akamai Bypass API solves this challenge from a single HTTP call.
Challenge Flow Overview
The SBSD challenge follows a specific sequence of requests that must be executed in order:
Initial Page Request: Client makes a request to the protected website
Challenge Page Response: Server returns a challenge page with a script reference
Script Request: Client fetches the referenced script
Payload Construction & Submission: Client generates and submits the required payload
Access Grant: Upon successful verification, access to the website is granted
Implementation Guide
Step 1: Initial Page Request
Make a standard GET request to the target website. When the site is protected by SBSD, instead of receiving the actual content, you'll receive a challenge page.
<html>
<body>
<script src="/6mGXhhKgo3Cn/HH/EB0WcpIr3K/X0iuwmY3aY/UkZyWg/Dy/J1CmB4HUQ?v=99b02ce6-f91f-0f49-40ae-6f8493e30211&t=183446611"></script>
<script>
(function() {
var chlgeId = '';
var scripts = document.getElementsByTagName('script');
for (var i = 0; i < scripts.length; i++) {
if (scripts[i].src && scripts[i].src.match(/t=([^&#]*)/)) {
chlgeId = scripts[i].src.match(/t=([^&#]*)/)[1];
}
}
var proxied = window.XMLHttpRequest.prototype.send;
window.XMLHttpRequest.prototype.send = function() {
var pointer = this
var intervalId = window.setInterval(function() {
if (pointer.readyState === 4 && pointer.responseURL && pointer.responseURL.indexOf('t=' + chlgeId) > -1) {
location.reload(true);
clearInterval(intervalId);
}
}, 1);
return proxied.apply(this, [].slice.call(arguments));
};
})();
</script>
</body>
</html>
Step 2: Identify Challenge Signature
The response will contain an HTML page with a script tag that has essential parameters for solving the challenge. You need to extract:
Path: The script URL path
v parameter: A UUID value
t parameter: A challenge token
Example script tag:
From this example:
Path:
/6mGXhhKgo3Cn/HH/EB0WcpIr3K/X0iuwmY3aY/UkZyWg/Dy/J1CmB4HUQv parameter:
99b02ce6-f91f-0f49-40ae-6f8493e30214t parameter:
183446612
Implement a regular expression to extract these values:
Step 3: Fetch Challenge Script
Request the script using the extracted components:
You'll need to save this script content for use in the next step.
Step 4: Generate and Submit Payload
Using our API service, generate the SBSD payload by providing:
The extracted UUID (v parameter)
The page URL
The script content
Your User-Agent
Any existing sbsd_o cookie value, or the bm_so cookie value if sbsd_o is not present.
scriptUrl is optional but recommended: the absolute src of the SBSD script tag, query included, exactly as the page loads it. It lets the payload carry the script's own fingerprint signals; see the scriptUrl field.
Our API returns the properly formatted payload string and a context string. Store that context: every SBSD call you make after this one sends it and must not send script. The two fields are mutually exclusive, a request containing both is rejected with an error. The first call can send the script's sha256 as scriptHash instead of script, see Script Hash.
Step 5: Submit the Solution
POST the generated payload to the challenge endpoint:
Step 6: Access Protected Content
If the payload is correct, you can now make requests to the protected website and receive the actual content instead of the challenge page.
Implementation Example
Here's a pseudocode example showing the complete flow:
Important Notes
Keep Headers Consistent: Align your headers with Chrome using a TLS client.
Header Order Matters: Akamai verifies header ordering on all requests
Cookie Management: Properly store and reuse any cookies set by the server
Context Handling: Store the
contextfrom each response and send it on the next SBSD call, without thescript
Integration with Our API
Our API simplifies the most complex part of this process - generating the correct payload. By providing the necessary parameters to our service, you receive a properly formatted payload ready for submission.
For detailed integration instructions and API endpoints, refer to our API Reference Documentation.
Last updated

