Learning resourcesReviewed · xAI

X Post to Fact-Check

X Post to Fact-Check is an xAI tutorial for developers building a fact-checker for X posts, but its citation controls do not establish that its verdicts are accurate. It teaches a TypeScript application that uses Grok, web search and X search to research claims concurrently and draft a note with numbered sources.

Researched 15 Nov 2026

In short.

X Post to Fact-Check is an xAI tutorial for developers building a fact-checker for X posts, but the page does not establish how accurate its verdicts are. The documented application reads post text and media, extracts up to four claims, researches them concurrently and drafts a note restricted to sources returned by searches. It supports a local web interface, terminal output and optional four-agent research. API calls incur charges, deep research stores responses for 30 days, and the application was not executed for this assessment.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage is the complete selected documentation page at [https://docs.x.ai/cookbook/examples/x-post-fact-check.md]. Linked pages, referenced implementation files, underlying example sources and live API responses are excluded. No explicit license notice appears in the supplied page. Described behavior, costs and timings are documentation claims; no application code was executed.

The overview

Identity

This xAI cookbook page teaches an example application for checking claims in an X post against web pages and other X posts. Its original address is [https://docs.x.ai/cookbook/examples/x-post-fact-check.md]. The resource is a development tutorial with a described TypeScript implementation, local web interface and command-line entry point.

Assessment

The useful pattern is the separation of post reading, parallel claim research and final note writing. The tutorial explains how to expose progress and restrict citations to retrieved sources, making it relevant to developers building research assistants.

Those restrictions constrain which sources an answer may cite. They do not independently establish whether a source is reliable or actually supports the associated sentence. The page supplies illustrative results rather than a measured accuracy evaluation.

Users

The tutorial suits developers learning tool-assisted research, structured model output, concurrent requests and streamed interfaces. Beginners receive setup commands and a three-stage explanation; experienced developers get details about citation events, JSON schemas, server-sent events and cancellation.

Following the implementation assumes familiarity with npm, environment variables and JavaScript or TypeScript. People seeking dependable fact-checking results should expect to inspect the extracted claims and supporting sources themselves.

Capabilities

The described app accepts an X post link, reads its text, images and video, and extracts up to four claims. Each claim receives a separate research request using webSearch() and xSearch(), with supported, missing context or not enough evidence as the available verdicts.

The web interface streams the post, claims, searches, discovered pages and final note. The terminal interface saves Markdown and JSON results to output/. Optional deep research assigns four agents to each claim. Stop and page closure trigger cancellation through an AbortSignal passed to requests.

Using it

Requirements

The stated runtime requirement is Node.js 22.13 or later. Setup also requires npm, the example repository and an xAI API key supplied as XAI_API_KEY. The page names grok-4.7 for reading posts and grok-4.20-multi-agent for optional deep claim research.

The application depends on API access to X search and web search. Its browser interface loads post media directly from X servers. Operating-system support, hardware requirements and the exact SDK dependency version are not specified on the page.

Mechanism

The shared factCheck() function coordinates three stages. readPost() retrieves the post and extracts structured claims; it fails if the requested post is absent from returned citations. checkClaim() researches each claim concurrently, filters proposed sources against citation events and applies the documented evidence requirements for each verdict. Failed claim requests become not enough evidence while other claims continue.

writeNote() numbers the retained sources and requests sentences with source numbers. An enum restricts those numbers to retained sources, and minItems: 1 requires a citation for every sentence. Claims without retained sources are omitted. Callbacks let the server and terminal present the same underlying progress.

Setup

With the example repository available locally, put the API key in a root .env file or export XAI_API_KEY. Change to examples/x-post-fact-check/typescript, run npm install, then npm run web. Open [http://localhost:3000], paste a post link and select Fact-check.

For terminal use, run npm start -- followed by the post URL; add --deep for deep research. Without a supplied URL, the example defaults to its GameStop sample. The selected page does not provide a repository acquisition command.

Example

The tutorial reports that its GameStop example classified a claim about approximately $57 million of CEO purchases as missing context because the filings and post image reportedly totaled about $74 million. This illustrates the intended combination of media interpretation and external research; the underlying records are not included on the page.

The author reports a 39-second check for a Starship post and roughly three minutes for the GameStop post, which had twice as many claims and encountered a slow API. These are individual reported examples, not independently reproduced benchmarks.

Assessment & evidence

Limitations

Extracting up to four claims does not establish comprehensive coverage of a post. Retrieval failures can prevent post reading or produce not enough evidence, and claims with no kept source (for example, claims whose research request failed or whose searches returned no usable citation) are left out of the final note. Readers should inspect the individual claim results alongside that note.

Deep research stores responses for 30 days by default. The page explains that disabling storage requests encrypted reasoning, and the multi-agent response can then contain an event exceeding the SDK's described 1 MiB read limit. Only the leading agent's tool calls are visible, so the interface does not show every search performed.

Reasoning

The design gives the model less freedom to invent citations by restricting outputs to returned source identifiers. The resulting safeguard concerns source identity; source credibility, interpretation and factual support still require judgment.

All three stages use low reasoning effort. For grok-4.20-multi-agent, the tutorial says effort controls agent count: low or medium uses four agents, while high or xhigh uses 16. The example uses low. That model supports the built-in search tools used here but does not accept custom functions.

Alternatives

Within this example, the default research path and optional deep mode offer two approaches to investigating each claim. The web interface provides visual progress and media previews; the terminal interface provides saved Markdown and JSON artifacts.

The page supplies no controlled comparison between those research modes or against other fact-checking tools. Relative accuracy, completeness and value for money are unknown.

Evidence

The evidence is xAI's own tutorial, containing setup commands, architecture descriptions, named implementation files and author-reported examples. It does not include the complete implementation, raw search responses, an accuracy dataset or an independent evaluation.

The application was not executed for this assessment. Installation success, API compatibility, cancellation behavior and factual accuracy remain unverified.

Access & freshness

Costs

The tutorial reports approximately $0.15 for the Starship example and $0.30–$0.40 for the GameStop example. It attributes about one-third of those costs to searches and the remainder to 50,000–130,000 tokens. It quotes X Search at $5 per 1,000 fetched posts and web search at $5 per 1,000 searches.

The page says both interfaces display the API-reported cost after a check. These examples are not a guaranteed budget or confirmation of current prices. Model-specific token rates, deep-research costs and costs for other posts are unknown from this evidence.

Rights

The selected page provides no explicit license or redistribution terms for the tutorial or referenced implementation files. Permission to copy, modify or redistribute them is therefore unknown from this evidence. Rights to reuse third-party post text, media and retrieved source material are also not established.

Freshness

The supplied documentation snapshot was captured on 15 November 2026. The page itself supplies no publication or last-updated date. Its model identifiers, search prices, response-storage behavior and SDK stream-size constraint describe that snapshot; their current applicability has not been independently established.

Actions

Begin with a post whose factual context you understand. Compare the extracted claims with the full post and media, then open each cited source to check its date, relevance and support for the associated sentence. Review claims omitted from the final note.

Before adapting the example, confirm current model access and pricing, inspect the implementation and its license, and decide whether deep mode's documented 30-day response storage suits the material being processed. Measure cost and accuracy on representative posts before relying on the results.

Evidence for this report

selected-page.txtselected · checked 2026-11-15