How to Write Grok AI Search Prompts That Find the Right Posts

A magnifying glass on a blue surface, a stand-in for the narrow, targeted searches good Grok AI search prompts ask for
Photo by Markus Winkler on Pexels

Grok AI search prompts work best when they read like a brief to a researcher. Say where Grok should look and which dates count, then say what the answer is for. Grok can search the open web and X in real time, and a vague prompt leaves it to guess both of those, which is how you end up with a confident summary of posts from last Tuesday.

The fix takes about ten extra words per prompt. The rest of this piece shows which ten.

How Grok AI search prompts reach the web and X

Grok has two search tools. One searches the web and reads pages; the other searches posts and accounts on X. Your prompt decides which one runs and how narrowly.

The clearest view of those tools is the developer side. xAI's documentation describes a Web Search tool and an X Search tool, each with a handful of switches:

ToolWhat a developer can set
Web SearchUp to 5 allowed domains, or up to 5 excluded domains (never both in one request); image understanding
X SearchUp to 20 allowed handles, or up to 20 excluded handles (never both); a from date and a to date; image and video understanding

X Search also runs several kinds of lookup, keyword search and semantic search among others. Semantic search matches on meaning, so a post can turn up without containing a single term from your prompt.

In the Grok app you do not get those switches. What you type is the nearest thing to them, so a strong search prompt says in plain English what those parameters would have said. Name the sources. Give the date window. Everything you leave out, the model fills in with its own defaults, and its defaults were set by someone who has never met your deadline.

AI prompt examples for Grok search, before and after

The pattern is easier to see than to describe. Each vague prompt below is a real question people ask; the rewrite adds scope and a time window.

VagueSearch-ready
What's happening with the Fed?Search news sites and X for reactions to this week's Federal Reserve rate decision. Summarise what changed, then quote the two analysts cited most often, with links.
What do people think of the new iPhone?Search X posts from the last 7 days about battery life on the newest iPhone. Separate posts by tech reviewers from ordinary user complaints, and give rough counts for each.
Is this library any good?Search the project's GitHub issues and official docs. List open bugs from the past three months that affect streaming, with a link to each issue.

Every rewrite carries the same three parts:

  • Scope: the sites, accounts or document types worth reading
  • Window: the dates that make a result current enough to count
  • Shape: what the answer should look like when it comes back, including links

The shape matters more than people expect. Asking for links turns a summary you have to trust into one you can check. "What's happening with AI" is a search query in roughly the way "food" is a dinner order.

Prompting Grok to search X: handles, dates and threads

X is Grok's home turf: it can read posts as they appear. It pays off most when you tell it whose posts to read and over what period.

Hands scrolling a smartphone feed in a dim room, the kind of fast-moving X timeline that Grok AI search prompts point the model at
Photo by Craig Adderley on Pexels

A few habits cover most of it:

  • Name handles when you know them. "Posts from @nasa and @spacex since Monday" beats "posts about the launch".
  • Give dates as dates. "Recently" means an hour to a news desk and a quarter to a finance team.
  • Ask for whole threads when context matters. A single reply lifted out of its thread reads very differently from the conversation it belonged to.

An X thread read from a stray reply is a punchline with no setup. Grok will still explain it to you, with total confidence, which is the problem.

One caution about what comes back. Posts are opinions and first reports, and early reports on a breaking story are often wrong. Ask Grok to label which claims come from primary sources and which come from commentary, and check the primary ones yourself before repeating them.

What Grok's system prompts reveal about its search habits

A system prompt is the standing instruction a vendor gives a model before your message arrives. xAI publishes Grok's in a public grok-prompts repository on GitHub, which makes it one of the few AI tools where you can read the house rules directly.

The Grok 4 prompt has three lines that change how you should write search prompts:

  • On X, it is told not to shy away from deeper and wider searches. The default leans broad, so if you want a narrow search, say so.
  • On controversial queries, it is told to search a distribution of sources representing all stakeholders, and to "assume subjective viewpoints sourced from media are biased." Expect balance by default, and specify sources if you need a particular set.
  • When a question is about Grok's own identity or preferences, it is told to avoid searching the web or X, even when asked.

That last one means "search what people are saying about Grok" is the one research request Grok is instructed to sit out. Which is more self-restraint than most of us show with our own name in a search bar.

What this means if you optimize content for AI search engines

Everything above has a mirror image for anyone publishing on the web. A Grok user writing a search prompt is deciding which sources get read, and those decisions can include or exclude you by name.

Through the API, a developer who sets five allowed domains has defined the entire internet for that answer. A chat user who writes "check the official docs and GitHub issues" has done something close to the same. Pages that state a clear date and answer one question plainly are easier for a model to pick up and quote, and pages buried under a paywall or a vague headline are easier to skip.

We cover the publisher's side in more depth in how to improve brand visibility in AI search engines. The short version: write the page a researcher with a narrow brief would want to find.

How to organize AI prompts you rerun

The search prompts worth writing well are the ones you run every week. Save those as templates with slots, so the structure survives and only the details change:

Search {sources} for {topic} between {start_date} and {end_date}.
Return {format}, with a link for every claim.
Skip {excluded_sources}.

Keep templates in one place with the date you last checked their results, since a prompt that pulled good sources in March can quietly drift by September as sites change. A shared document works; a prompt library in your notes app works too. Adding the reason behind each constraint helps the model handle cases your template never anticipated, a pattern we unpack in cause and effect AI prompts.

If you move from the app to the API, shift constraints out of the prose and into parameters. A domain filter is enforced; a sentence asking nicely is a suggestion. Designing that split between instructions and tools is a core topic in Agentic AI Engineering.

Watch the cost when you do. xAI bills X Search at $5 per 1,000 posts fetched and $10 per 1,000 user profiles fetched, on top of token costs. A broad prompt with no date range invites the deep, wide search the system prompt encourages, and the bill scales with it. Date ranges and handle lists are the cheapest controls you have.

Before you send your next Grok search prompt, run this check:

  • Did you name the sources or accounts worth reading?
  • Did you give a date window as actual dates?
  • Did you describe the shape of the answer and ask for links?
  • Did you say which claims need primary sources?

For the wider craft of turning one good prompt into a system you can maintain, AI Prompt Engineering covers prompt components and evaluation in depth.

Frequently asked questions

What is a negative prompt in AI?

A negative prompt describes what the model should leave out. In image generators it is often a separate field listing unwanted features. In a Grok search prompt the equivalent is an exclusion, such as telling it to skip a site or an account. Through the xAI API, excluded domains and excluded X handles turn that request into a hard filter.

How do you prompt AI to write like a human?

Give it a specific reader and a register, and paste a short sample of the voice you want. Ask it to put the answer first and cut filler phrases. For search summaries, asking for plain sentences with a link after each claim reads far more naturally than a wall of bullet points.

Can you limit Grok's search to specific websites?

Yes. Through the API, the Web Search tool accepts up to five allowed domains or up to five excluded domains, though not both in one request. In the Grok app, name the sites in your prompt; it treats that as an instruction the model weighs, so check the links it returns.

How much does Grok's X search cost through the API?

xAI bills X Search at $5 per 1,000 posts fetched and $10 per 1,000 user profiles fetched, on top of the normal token costs. Adding a date range and a list of handles keeps the number of fetched posts down, which keeps the bill down with it.

Where can I find the system prompts and models of AI tools?

xAI publishes the system prompts behind Grok in its grok-prompts repository on GitHub, including prompts for Grok 4 and Grok 4.1 and for features such as the @grok bot on X. Other vendors differ in how much they share, so check each provider's own documentation.

Sources