Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 4 min read

Does Meta AI recommend your brand? How to check, with code

A growing share of "what should I buy" questions never reach a search results page. They go to an AI assistant, which answers with three or four names. If yours is not one of them, you are not in the running. Tools exis

A growing share of "what should I buy" questions never reach a search results page. They go to an AI assistant, which answers with three or four names. If yours is not one of them, you are not in the running.

Tools exist to check this for ChatGPT, Gemini, Perplexity and Google's AI answers. I could not find one for Meta AI, so I looked at how to do it properly.

Meta has an official way in

Since July 2026 Meta offers its Muse Spark model, the one behind Meta AI, through a developer API with web search built in. No scraping of the app needed.

A request looks like this:

curl https://api.meta.ai/v1/responses \
  -H "Authorization: Bearer $META_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "muse-spark-1.3",
    "input": "What are the best running shoes for flat feet?",
    "tools": [{"type": "web_search"}]
  }'

The response contains the answer text, the web searches the model ran, and url_citation annotations pointing at the pages it relied on.

The cost trap

My first request, with the settings above and nothing else, came back with:

  • 3 web searches and 3 pages opened,
  • 25,430 input tokens and 4,112 output tokens,
  • a bill of about 6 cents for one question.

The model had decided to research the topic thoroughly. Great for a person, expensive if you want to ask 200 questions every week.

Three settings brought it down to about 1.5 cents, measured over five different questions:

{
    "max_tool_calls": 2,
    "reasoning": { "effort": "minimal" },
    "max_output_tokens": 2500
}

Two things I got wrong on the way:

  • max_output_tokens includes the model's reasoning. I first set it to 900 and got answers cut off after one sentence, with status incomplete. Leave room.
  • Ask for a short answer in the instructions. "Keep the answer under 250 words" does more for cost and readability than any token limit.

Turning an answer into a measurement

The answer text alone tells you little. What you want per question is:

  1. Is my brand named?
  2. In what order are the brands named?
  3. Which websites does the answer cite?

Detection is a whole-word, case-insensitive search for each brand name, ordered by where each first appears:

import re

def brands_in(answer, brands):
    found = []
    for name in brands:
        pattern = rf"(?<![\w]){re.escape(name)}(?![\w])"
        hits = [m.start() for m in re.finditer(pattern, answer, re.IGNORECASE)]
        if hits:
            found.append((min(hits), name, len(hits)))
    return [(name, count) for _, name, count in sorted(found)]

Whole words matter. Without them, the shoe brand "On" matches every "online" and "only" in the text.

For the cited websites, collect the url of each url_citation annotation on the final message. The response also contains short "commentary" messages where the model narrates its search; skip those and keep the last message.

What it looks like on real questions

I asked three questions about running shoes and tracked six brands. In those three answers:

Brand Answers mentioning it Named first
ASICS 3 of 3 2
Brooks 3 of 3 1
New Balance 3 of 3 0
Hoka 2 of 3 0
Nike 2 of 3 0
Saucony 1 of 3 0

Three answers is far too few to conclude anything about those brands. It shows the shape of the result: a share of answers and an order, per brand.

Two things stood out even at this size:

  • Answers change between runs. The same question asked again named the brands in a different order. One run per question is an anecdote; ask each question several times.
  • Not every answer cites a source. The model decides whether to search and whether to cite. In my runs only about a third of the answers carried citations.

The packaged version

I turned this into a tool: Meta AI Brand Visibility Tracker on Apify. You give it your brand, your competitors and your questions; it returns one row per answer plus a summary.

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("spokentext/meta-ai-brand-visibility").call(run_input={
    "brand": "Brooks",
    "competitors": ["ASICS", "Hoka", "New Balance"],
    "questions": [
        "What are the best running shoes for flat feet?",
        "Which running shoe brand is best for beginners?",
    ],
})

for row in client.dataset(run.default_dataset_id).iterate_items():
    print(row["question"])
    print("  mentioned:", row["brandMentioned"], "| position:", row["brandPosition"])
    print("  competitors named:", row["competitorsMentioned"])
    print("  cited:", row["citedDomains"])

It costs $0.05 per answer, and it also lists every product the answer put in bold, which is how you find competitors you did not think to track.

Limits worth knowing

  • It is not a copy of the app. The answers come from the same model family through Meta's developer API. The Meta AI app can personalise, so what one person sees there may differ.
  • It needs a paid Apify plan. Every answer is bought from Meta, so the free plan returns labelled sample rows only.
  • Short brand names are noisy. "On", "Apple" or "Target" match ordinary words even with whole-word matching. Check those against the answer text.
  • It tracks what you list. Unlisted brands only show up among the bolded terms.

If you only remember one thing

Ask each question more than once, and look at the share of answers, not at a single reply. An AI assistant is not a ranking with fixed positions; it is closer to a poll.

Disclosure: I built the tool described above. It is an independent tool, not affiliated with Meta. This article was drafted with AI assistance and checked by me.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.