Skip to main content

cookielessaudiences (Python)

Cookieless audience data for a URL, as a Python call. You pass a page and receive demographics, interests, purchase intent, B2B firmographics and personas, with no cookies and no personal data involved.

Built on requests, works on Python 3.7 and later.

Setup

pip install cookielessaudiences

An API key comes with any plan. If you are still comparing options, read how cookieless audience segmentation works before you buy.

Quick start

from cookielessaudiences import CookielessAudiences, labels_for

client = CookielessAudiences("YOUR_API_KEY")
result = client.segment("https://example.com/blog")

print(result["audience_type"])
print(result["demographics"]["income_level"])
print(labels_for(result))

Reading the response

Think of the structured result as five questions about the reader of a page:

  1. Who are they? demographics and b2b
  2. What do they like? interests, two tiers of INT.* codes
  3. What might they buy? purchase_intent, PI.* codes
  4. Which named audiences fit? personas
  5. What kind of page is it? content_context

labels_for(result) turns the codes in questions 2 and 3 into names you can show to a person.

API surface

client.segment(url, structured=True)
client.categorize(url, confidence=True, root_fallback=False)
client.categorize_text(text, confidence=True)
client.segment_many(urls, workers=8)
CookielessAudiences.vocabularies()

segment_many returns a dict of url to result. A URL that failed holds its exception instead, so one bad page never stops a batch.

Errors

from cookielessaudiences import CookielessAudiencesError

try:
    client.segment(url)
except CookielessAudiencesError as exc:
    print(exc.status, exc.body)

The HTTP layer is plain; the signal lives in status inside the JSON. 401 is a bad key, 403 means the key is inactive or credits are gone, 410 and 411 mean the page could not be read.

Example: audience report for a media plan

import csv
from cookielessaudiences import CookielessAudiences, labels_for

client = CookielessAudiences("YOUR_API_KEY")
sites = [line.strip() for line in open("sites.txt") if line.strip()]
results = client.segment_many(sites, workers=10)

with open("plan.csv", "w", newline="") as fh:
    out = csv.writer(fh)
    out.writerow(["site", "type", "age", "income", "top_interest", "top_intent"])
    for site, res in results.items():
        if isinstance(res, Exception):
            out.writerow([site, "error", "", "", "", ""])
            continue
        names = labels_for(res)
        out.writerow([
            site,
            res.get("audience_type"),
            "|".join(res["demographics"].get("age_bracket", [])),
            res["demographics"].get("income_level"),
            (names["interests"] or [""])[0],
            (names["purchase_intent"] or [""])[0],
        ])

This is the shape most website audience demographics work takes: many sites in, one row per site out.

Example: pandas enrichment

import pandas as pd

df = pd.read_csv("accounts.csv")           # column: url
found = client.segment_many(df["url"].tolist())
df["audience_type"] = [r.get("audience_type") if isinstance(r, dict) else None for r in found.values()]
df["seniority"] = [
    ",".join(r.get("b2b", {}).get("seniority", [])) if isinstance(r, dict) else None
    for r in found.values()
]

Example: IAB categories for a text snippet

snippet = "Best budget laptops for students heading to university"
cats = client.categorize_text(snippet)
for name, score in cats["iab_classification"]:
    print(name, score)

Frequently asked

Can I get the full word list for a field? Yes. CookielessAudiences.vocabularies() returns every enumerated value and needs no key.

What about scale? The service accepts up to 50 parallel threads by default, about 270 URLs a minute.

Which fields are free text? None in the structured shape. Small fields are closed lists; open-ended signals are mapped to canonical codes or dropped.

Package notes

MIT licensed. Questions go to info@alpha-quantum.com. Version 1.0.0.

Metadata

Release files for cookielessaudiences 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cookielessaudiences 1.0.0
File Size Uploaded Provenance Actions
cookielessaudiences-1.0.0.tar.gz 6.4 kB Without provenance Details for cookielessaudiences-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cookielessaudiences 1.0.0
File Interpreter ABI Platform Actions
cookielessaudiences-1.0.0-py3-none-any.whl Python 3 none any Details for cookielessaudiences-1.0.0-py3-none-any.whl

Total release size: 12.8 kB

Release files / cookielessaudiences-1.0.0.tar.gz

Download URL cookielessaudiences-1.0.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c43a49e8a29543e46c9a74da85a9f2e423c80184a880cde228774beb9451fb3a
BLAKE2b-256 checksum
How to use checksums
b6cbd6d20dc6343e4a9cb370fb8c84a2f29530362297bfcdca13483383f31922
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release files / cookielessaudiences-1.0.0-py3-none-any.whl

Download URL cookielessaudiences-1.0.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c82457d779f094d749af49462472997488b1f7d268819aeebba1099357c19935
BLAKE2b-256 checksum
How to use checksums
5fe82d41ac6180f4599ff067cb04ee65c0f7b8658ee0976eec911bf792ddb5ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Security for cookielessaudiences 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page