> ## Documentation Index
> Fetch the complete documentation index at: https://modem.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# X

> Monitor public posts matching your search queries

export const Prompt = ({text, variant = 'accent'}) => {
  const [copied, setCopied] = useState(false);
  const handleCopy = async () => {
    try {
      await navigator.clipboard.writeText(text);
      setCopied(true);
      setTimeout(() => setCopied(false), 2000);
    } catch {}
  };
  const clipboardIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
            <title>Copy</title>
            <rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
            <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
        </svg>;
  const checkIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
            <title>Copied</title>
            <polyline points="20 6 9 17 4 12" />
        </svg>;
  const promptIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style={{
    flexShrink: 0,
    opacity: 0.4
  }}>
            <title>Prompt</title>
            <path d="M20 2H2v20h2V4h16v12H6v2H4v2h2v-2h16V2zM6 7h12v2H6zm8 4H6v2h8z" />
        </svg>;
  return <div className={`prompt prompt-${variant}`} style={{
    marginTop: '12px',
    marginBottom: '12px'
  }}>
            {promptIcon}
            <span className="prompt-text">{text}</span>
            <button className="prompt-copy" onClick={handleCopy} title="Copy to clipboard" type="button">
                {copied ? checkIcon : clipboardIcon}
            </button>
        </div>;
};

The X integration monitors public posts that match search queries you define. Matched posts are ingested into Modem, grouped into [topics](/docs/guides/topics), and linked to [people](/docs/guides/people) and [companies](/docs/guides/people#companies) like any other data source.

<Info>
  The X integration is capture-only. Unlike [Slack](/docs/integrations/slack), you can't interact with the Modem Agent from X. Posts are polled
  periodically rather than streamed in real time.
</Info>

## Prerequisites

* Owner or admin role in your Modem organization
* At least one project to assign posts to

## Setup

<Steps>
  <Step title="Enable the integration">
    Go to **Settings** > **Integrations** > **X** in your Modem dashboard and click **Enable X**.
  </Step>

  <Step title="Add a search query">
    Click **Add Query** to define what posts to monitor. Each query has three fields:

    * **Search Query**: The X search syntax to match against (e.g. `@yourcompany OR "your product"`)
    * **Display Name**: A label shown in Modem to identify this query (e.g. "Company Mentions")
    * **Project**: Which project the matched posts should be assigned to

    See [Writing Search Queries](#writing-search-queries) below for syntax help.
  </Step>

  <Step title="Wait for results">
    Modem polls X periodically for new results. Matched posts will begin appearing in your project shortly after the first poll runs.
  </Step>
</Steps>

## Writing Search Queries

Search queries use the [X API v2 search syntax](https://developer.x.com/en/docs/twitter-api/tweets/search/integrate/build-a-query). A few common patterns:

| Goal                         | Query                            |
| ---------------------------- | -------------------------------- |
| Posts mentioning your handle | `@yourcompany`                   |
| Posts containing a phrase    | `"your product name"`            |
| Multiple terms (any match)   | `@yourcompany OR "your product"` |
| Exclude retweets             | `@yourcompany -is:retweet`       |
| From a specific account      | `from:yourcompany`               |

You can combine operators to build precise queries. Queries that are too broad will capture noise, so start specific and widen if needed.

<Tip>
  A good starting point is `@yourcompany OR "your product name" -is:retweet`. This captures mentions and product references while
  filtering out retweets.
</Tip>

## Managing Queries

You can add multiple search queries, each targeting a different keyword, handle, or project. Manage them from **Settings** > **Integrations** > **X**.

* **Pause/Resume**: Temporarily stop polling a query without deleting it
* **Delete**: Permanently remove a query

Each query shows its display name, the raw search syntax, and when it was last polled.

## What Gets Captured

For each matched post, Modem captures:

* Post text and metadata (timestamps, conversation threading)
* Author name, username, and avatar
* Engagement metrics (likes, reposts, replies, quotes)
* Entities (mentions, hashtags, URLs)
* Reply relationships (which post a reply is responding to)

<Note>
  Only public posts are captured. Modem cannot access direct messages, posts from protected accounts, or posts older than approximately 7
  days.
</Note>

## Querying X Data

Once posts are flowing in, you can ask the Modem Agent about them from the dashboard or [Slack](/docs/integrations/slack).

<Prompt text="What are people saying about us on X this week?" />

<Prompt text="Summarize the top complaints from X mentions" />

<Prompt text="Create a Linear ticket for the bug reports coming in from X" />

## Troubleshooting

<AccordionGroup>
  <Accordion title="No posts are appearing">
    * Verify the integration is enabled in **Settings** > **Integrations** > **X**
    * Check that your search query matches real posts (test it on X's search page first)
    * Make sure the query is not paused
    * Allow a few minutes for the first poll to run
  </Accordion>

  <Accordion title="Too many irrelevant posts">
    Your search query may be too broad. Try narrowing it:

    * Add `-is:retweet` to exclude retweets
    * Use quoted phrases (`"exact phrase"`) instead of individual words
    * Add `-from:youraccount` to exclude your own posts
  </Accordion>

  <Accordion title="Missing recent posts">
    Modem polls periodically, so there can be a short delay. If posts are consistently missing, check that your query syntax is correct. The X API recent search endpoint only returns posts from the last 7 days.
  </Accordion>
</AccordionGroup>

## Disconnecting

To disable the X integration:

1. Go to **Settings** > **Integrations** > **X**
2. Click **Disable**

This stops all search query polling. Historical data remains in Modem after disconnecting.

## Related

<CardGroup cols={2}>
  <Card title="Topics" icon="https://mintcdn.com/modem-844d7a4a/Wr2r4IRr97lNQiQb/icons/label-alt-multiple.svg?fit=max&auto=format&n=Wr2r4IRr97lNQiQb&q=85&s=e7fbaf23c28396ac670b89cf38e1e4a6" href="/docs/guides/topics" width="24" height="24" data-path="icons/label-alt-multiple.svg">
    How Modem groups and classifies the posts it captures.
  </Card>

  <Card title="The Modem Agent" icon="https://mintcdn.com/modem-844d7a4a/Wr2r4IRr97lNQiQb/icons/bot.svg?fit=max&auto=format&n=Wr2r4IRr97lNQiQb&q=85&s=2496f9106cb54fa9f4e27ad1f8f3a171" href="/docs/features/agent" width="22" height="22" data-path="icons/bot.svg">
    Ask questions and take action on your X data.
  </Card>
</CardGroup>
