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

# Global Search

> Search Telegram globally by query string

Search for messages globally across Telegram matching a query string.

## Query Parameters

<ParamField query="q" type="string" required>
  Search query string (1-1000 characters). You can also use `query` instead of
  `q`.
</ParamField>

<ParamField query="limit" type="number" default="20">
  Number of results to return (1-100)
</ParamField>

## Response

<ResponseField name="total" type="number">
  Total number of matching messages found
</ResponseField>

<ResponseField name="messages" type="array">
  <Expandable title="properties">
    <ResponseField name="id" type="number">
      Message ID
    </ResponseField>

    <ResponseField name="text" type="string">
      Message text content
    </ResponseField>

    <ResponseField name="date" type="number">
      Unix timestamp of the message
    </ResponseField>

    <ResponseField name="channelId" type="string | null">
      ID of the channel
    </ResponseField>

    <ResponseField name="channelTitle" type="string | null">
      Title of the channel
    </ResponseField>

    <ResponseField name="fromId" type="string | null">
      ID of the sender
    </ResponseField>

    <ResponseField name="views" type="number | null">
      Number of views
    </ResponseField>

    <ResponseField name="forwards" type="number | null">
      Number of forwards
    </ResponseField>

    <ResponseField name="hasMedia" type="boolean">
      Whether the message contains media
    </ResponseField>

    <ResponseField name="mediaType" type="string | null">
      Type of media (`photo`, `video`, `document`, `url`, or `null`)
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash theme={null}
  curl -X GET "https://scrape.st/telegram/search?q=crypto&limit=20" \
    -H "x-api-key: YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "total": 1500,
    "messages": [
      {
        "id": 123456,
        "text": "Bitcoin is pumping today!",
        "date": 1714567890,
        "channelId": "1001234567",
        "channelTitle": "Crypto News",
        "fromId": "987654321",
        "views": 5000,
        "forwards": 120,
        "hasMedia": true,
        "mediaType": "photo"
      }
    ]
  }
  ```
</ResponseExample>
