Microlink adblock now handles cookie banners
Kiko Beats
February 16, 2026 ()
Cookie banners are one of the most annoying things on today’s internet.
If you take screenshots, generate PDFs, or extract metadata, you eventually hit the same problem: the page loads, but a consent popup covers the content.
Today, we’re announcing a major upgrade to Microlink adblock, powered by
browserless
, our own headless browser runner behind the Microlink API.What's new
From today, when Microlink’s adblock is enabled, cookie consent banners are handled automatically.
The same request with adblock disabled and enabled
With this release, one parameter now covers both:
- ad and tracker request blocking.
- automatic cookie banner handling for supported CMPs.
For common cases, you no longer need custom Puppeteer scripts. This also speed up response resolution.
Why this matters
Historically, hide cookie banners popup require site-specific scripts, brittle selectors, and constant maintenance. This could be achieved in many ways:
- hardcoded selectors per site.
- generic "click accept" scripts.
- filter lists only.
- CMP-specific logic.
- browser extensions.
In fact we ways for doing that:
- click to interact with selectors.
- styles to inject CSS overrides.
- scripts to inject JavaScript.
- modules to load module-based logic.
- waitForSelector to wait for stable states before capture
However, the issue is always there: as soon as the target URL markup changes, the approaches needed to be updated.
Now Microlink API is enough smart to detect cookies banners common case, avoid you to write domain-specific one-offs while keeping the rest of your request flow unchanged.
The same request with adblock disabled and enabled
Still, for complicated or corner cases you can continue use query parameters, but that should be less common than before.
How to use it
The adblock capabilities are enabled by default, so you don't need to do nothing special, just continue using Microlink API as normal:
The following examples show how to use the Microlink API with CLI, cURL, JavaScript, Python, Ruby, PHP & Golang, targeting 'https://www.nytimes.com/' URL with 'screenshot' & 'adblock' API parameters:
CLI Microlink API example
microlink https://www.nytimes.com/&screenshot&adblockcURL Microlink API example
curl -G "https://api.microlink.io" \
-d "url=https://www.nytimes.com/" \
-d "screenshot=true" \
-d "adblock=true"JavaScript Microlink API example
import mql from '@microlink/mql'
const { data } = await mql('https://www.nytimes.com/', {
screenshot: true,
adblock: true
})Python Microlink API example
import requests
url = "https://api.microlink.io/"
querystring = {
"url": "https://www.nytimes.com/",
"screenshot": "true",
"adblock": "true"
}
response = requests.get(url, params=querystring)
print(response.json())Ruby Microlink API example
require 'uri'
require 'net/http'
base_url = "https://api.microlink.io/"
params = {
url: "https://www.nytimes.com/",
screenshot: "true",
adblock: "true"
}
uri = URI(base_url)
uri.query = URI.encode_www_form(params)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
response = http.request(request)
puts response.bodyPHP Microlink API example
<?php
$baseUrl = "https://api.microlink.io/";
$params = [
"url" => "https://www.nytimes.com/",
"screenshot" => "true",
"adblock" => "true"
];
$query = http_build_query($params);
$url = $baseUrl . '?' . $query;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET"
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #: " . $err;
} else {
echo $response;
}Golang Microlink API example
package main
import (
"fmt"
"net/http"
"net/url"
"io"
)
func main() {
baseURL := "https://api.microlink.io"
u, err := url.Parse(baseURL)
if err != nil {
panic(err)
}
q := u.Query()
q.Set("url", "https://www.nytimes.com/")
q.Set("screenshot", "true")
q.Set("adblock", "true")
u.RawQuery = q.Encode()
req, err := http.NewRequest("GET", u.String(), nil)
if err != nil {
panic(err)
}
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}import mql from '@microlink/mql'
const { data } = await mql('https://www.nytimes.com/', {
screenshot: true,
adblock: true
})Under the hood
Microlink uses
browserless
, our own headless browser runner. For broader context, see what is a headless browser?.Inside that runner,
@browserless/goto
now combines:- ad/tracker blocking engine for third-party abusive requests, powered by ghostery/adblocker.
- autoconsent-based cookie handling configured for automatic opt-out powered by DuckDuckGo’s autoconsent.
- prehide/cosmetic behavior to reduce visual cookie overlays before capture.
When to disable it
You can set adblock=false if your workflow requires loading ads/trackers or validating the default consent UX.
The following examples show how to use the Microlink API with CLI, cURL, JavaScript, Python, Ruby, PHP & Golang, targeting 'https://www.nytimes.com/' URL with 'adblock' API parameter:
CLI Microlink API example
microlink https://www.nytimes.com/cURL Microlink API example
curl -G "https://api.microlink.io" \
-d "url=https://www.nytimes.com/" \
-d "adblock=false"JavaScript Microlink API example
import mql from '@microlink/mql'
const { data } = await mql('https://www.nytimes.com/', {
adblock: false
})Python Microlink API example
import requests
url = "https://api.microlink.io/"
querystring = {
"url": "https://www.nytimes.com/",
"adblock": "false"
}
response = requests.get(url, params=querystring)
print(response.json())Ruby Microlink API example
require 'uri'
require 'net/http'
base_url = "https://api.microlink.io/"
params = {
url: "https://www.nytimes.com/",
adblock: "false"
}
uri = URI(base_url)
uri.query = URI.encode_www_form(params)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
response = http.request(request)
puts response.bodyPHP Microlink API example
<?php
$baseUrl = "https://api.microlink.io/";
$params = [
"url" => "https://www.nytimes.com/",
"adblock" => "false"
];
$query = http_build_query($params);
$url = $baseUrl . '?' . $query;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET"
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #: " . $err;
} else {
echo $response;
}Golang Microlink API example
package main
import (
"fmt"
"net/http"
"net/url"
"io"
)
func main() {
baseURL := "https://api.microlink.io"
u, err := url.Parse(baseURL)
if err != nil {
panic(err)
}
q := u.Query()
q.Set("url", "https://www.nytimes.com/")
q.Set("adblock", "false")
u.RawQuery = q.Encode()
req, err := http.NewRequest("GET", u.String(), nil)
if err != nil {
panic(err)
}
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}import mql from '@microlink/mql'
const { data } = await mql('https://www.nytimes.com/', {
adblock: false
})Final notes
No cookie-banner strategy is perfect for every page on the internet.
But this release moves Microlink closer to what most teams need in production: cleaner captures, less custom code, and fewer brittle fixes.
If you want more context around the stack, read:
Join the community
All of these improvements or features are community driven: We listen to your feedback and act accordingly.
Whether you are building a product, an indie developer, or just interested in web technologies, come chat with us.



