Developer reference · The Optimly Index
Retrieve a Brand Profile
You can look up a published Brand Profile by name or domain without an account or key, then retrieve the same content as HTML, JSON or markdown. Keep each section’s source and date when you cite it.
Each section is publicly sourced by Optimly, approved by the brand owner, or generated by an Optimly experiment. A claimed profile is owner-attributable, not independently verified.
Look up by name or domain
Send the name or domain as a query. The lookup matches a brand’s display name, or an exact canonical URL or domain.
The working examples below accept an exact domain or exact name match. If the search returns only fuzzy candidates, they list them and stop; choose by domain, name and category rather than assuming the first result is the profile you want.
curl -sS 'https://optimly.ai/brands/search?q=stripe.com'
When you already know the exact domain, resolve identity directly. One selector per call; use q only when you have text rather than an exact key.
curl -sS 'https://optimly.ai/brands/query?domain=stripe.com'
| Authentication | None |
|---|---|
| Search path | GET /brands/search?q=<name-or-domain> |
| Identity selector | GET /brands/query?domain=<domain>, or id, url, slug or q |
| Selectors per call | Exactly one. More than one is a 400. |
| Results | Choose by domain, name and category. Do not assume the first row is the Brand Profile you want. |
A domain can resolve more than one Brand Profile: a company, a product line and a product are separate entities. Fetch the candidate and read its name, entity type and sections before you rely on it.
Retrieve the profile three ways
Every published Brand Profile has the same content in three forms. The canonical page URL is in the lookup result; use that, not the search URL.
| Format | URL | Use it for |
|---|---|---|
| HTML | /brand/{slug} | A human-readable page; no JavaScript required |
| JSON | /brand/{slug}.json | Structured sections with sources and dates |
| Markdown | /brand/{slug}/llms.txt | Plain-text retrieval, laid out for an agent |
# The JSON form, with per-section provenance
curl -sS 'https://optimly.ai/brand/stripe.json'
# The markdown twin
curl -sS 'https://optimly.ai/brand/stripe/llms.txt'
Unknown slugs return 404. A slug shared by several brands answers 301 to a disambiguation response; follow it and choose from entries. Build URLs from the canonical url in the response, not by guessing a slug.
Keep the source and date when you cite
Each section in the JSON form carries its own provenance. Keep that provenance attached to the sentence it supports rather than merging sections into one unattributed claim.
{
"key": "short_description",
"label": "What we do, in one sentence",
"content": "…",
"source_type": "1p_website",
"source_label": "Brand's website",
"source_url": "https://stripe.com",
"updated_at": "2026-10-04T00:05:21Z"
}
- Name the section, its
source_labeland itsupdated_atdate. - Include
source_urlwhen it is present. - Cite the canonical
urlfrom the profile, not a search result or redirect.
Stripe describes itself as “the most unified and developer-centric financial stack” for businesses scaling on a single set of APIs. Source: Stripe’s website (https://stripe.com), checked 2026-10-04, via the Optimly Index: https://optimly.ai/brand/stripe.
What the public Index is — and is not
The public Index is read-only
It needs no account and no API key. It exposes published Brand Profiles, their sections and sources, categories and the bulk feed. It accepts no writes and returns no measurement.
Publishing a Brand Profile makes approved information available to agents. It does not guarantee retrieval, citation or recommendation.
The MCP connector is not a public Index server
The MCP connector is authenticated, limited to a brand’s own BrandVault, and is not a public Index server. It reads the brands your organization owns and can publish reviewed updates; it does not expose the public corpus. Public brand data is HTTP-only today.
MCP endpoint: https://app.optimly.ai/api/mcp. See the MCP connector for setup and the tool list.
Working examples
These dependency-free clients show the whole path in Python and JavaScript: name/domain lookup, HTML/JSON/markdown retrieval, and keeping each section’s source and date. There is no SDK; both surfaces are plain HTTP and JSON.
The examples are checked against the shipped route and response contract in the test suite.
Python
"""Look up and retrieve an Optimly Brand Profile without an account or key.
The public Optimly Index is read-only; this client only performs GET requests.
"""
import json
import os
import urllib.parse
import urllib.request
BASE = os.environ.get("OPTIMLY_INDEX_BASE", "https://optimly.ai").rstrip("/")
class AmbiguousLookup(Exception):
"""The query did not resolve to one Brand Profile."""
def __init__(self, candidates):
super().__init__("choose a candidate by exact domain or name")
self.candidates = candidates
def key(value):
"""Compare names and domains without punctuation or case."""
return "".join(character for character in value.lower() if character.isalnum())
def get(path):
request = urllib.request.Request(
f"{BASE}{path}",
headers={"User-Agent": "optimly-index-docs-examples"},
)
with urllib.request.urlopen(request, timeout=20) as response:
return response.read().decode()
def lookup(query):
"""Resolve one Brand Profile, or raise with the candidates to choose from."""
params = urllib.parse.urlencode({"q": query})
items = json.loads(get(f"/brands/search?{params}"))["items"]
if not items:
raise LookupError(f"No Brand Profile found for {query!r}.")
raw = query.lower().removeprefix("www.")
wanted = key(raw)
domains = [item for item in items if key(item.get("domain") or "") == wanted]
if len(domains) == 1:
return domains[0]
if domains:
# A domain can hold several Brand Profiles. Prefer the one whose name
# matches the domain label; otherwise list them for an explicit choice.
label = key(raw.split(".", 1)[0])
named = [item for item in domains if key(item.get("name") or "") == label]
if len(named) == 1:
return named[0]
raise AmbiguousLookup(domains)
named = [item for item in items if key(item.get("name") or "") == wanted]
if len(named) == 1:
return named[0]
raise AmbiguousLookup(items)
def retrieve(slug, fmt="json"):
"""Fetch the same profile as HTML, JSON or markdown."""
path = {
"html": f"/brand/{slug}",
"json": f"/brand/{slug}.json",
"markdown": f"/brand/{slug}/llms.txt",
}[fmt]
return get(path)
def main():
try:
item = lookup("stripe.com")
except AmbiguousLookup as error:
print("Choose one candidate by exact domain or name:")
for candidate in error.candidates:
print(candidate.get("slug"), candidate.get("name"), candidate.get("domain"))
raise SystemExit(1)
profile = json.loads(retrieve(item["slug"]))
for group in profile["headers"]:
for section in group["sections"]:
print(section["label"], section["source_label"], section["updated_at"])
# The same profile as markdown or HTML:
# print(retrieve(item["slug"], "markdown"))
if __name__ == "__main__":
main()
JavaScript (Node 18+)
// Look up and retrieve an Optimly Brand Profile without an account or key.
// The public Optimly Index is read-only; this client only performs GET requests.
const BASE = (process.env.OPTIMLY_INDEX_BASE ?? "https://optimly.ai").replace(/\/+$/, "");
class AmbiguousLookup extends Error {
constructor(candidates) {
super("choose a candidate by exact domain or name");
this.candidates = candidates;
}
}
// Compare names and domains without punctuation or case.
const key = value => value.toLowerCase().replace(/[^a-z0-9]/g, "");
async function get(path) {
const response = await fetch(`${BASE}${path}`, {
headers: { "User-Agent": "optimly-index-docs-examples" },
});
if (!response.ok) throw new Error(`${response.status} ${path}`);
return response.text();
}
async function lookup(query) {
// Resolve one Brand Profile, or throw with the candidates to choose from.
const params = new URLSearchParams({ q: query });
const { items } = JSON.parse(await get(`/brands/search?${params}`));
if (!items.length) throw new Error(`No Brand Profile found for ${JSON.stringify(query)}.`);
const raw = query.toLowerCase().replace(/^www\./, "");
const wanted = key(raw);
const domains = items.filter(item => key(item.domain ?? "") === wanted);
if (domains.length === 1) return domains[0];
if (domains.length) {
// A domain can hold several Brand Profiles. Prefer the one whose name
// matches the domain label; otherwise list them for an explicit choice.
const label = key(raw.split(".")[0]);
const named = domains.filter(item => key(item.name ?? "") === label);
if (named.length === 1) return named[0];
throw new AmbiguousLookup(domains);
}
const named = items.filter(item => key(item.name ?? "") === wanted);
if (named.length === 1) return named[0];
throw new AmbiguousLookup(items);
}
async function retrieve(slug, format = "json") {
// Fetch the same profile as HTML, JSON or markdown.
const path = {
html: `/brand/${slug}`,
json: `/brand/${slug}.json`,
markdown: `/brand/${slug}/llms.txt`,
}[format];
return get(path);
}
async function main() {
let item;
try {
item = await lookup("stripe.com");
} catch (error) {
if (!(error instanceof AmbiguousLookup)) throw error;
console.log("Choose one candidate by exact domain or name:");
for (const candidate of error.candidates) {
console.log(candidate.slug, candidate.name, candidate.domain);
}
return;
}
const profile = JSON.parse(await retrieve(item.slug));
for (const group of profile.headers ?? []) {
for (const section of group.sections ?? []) {
console.log(section.label, section.source_label, section.updated_at);
}
}
// The same profile as markdown or HTML:
// console.log(await retrieve(item.slug, "markdown"));
}
main().catch((error) => {
console.error(error.message);
process.exitCode = 1;
});