---
title: "X (Twitter) API: Search Tweets | Perceptlayer"
description: "Search Tweets from X (Twitter) as JSON. 1 credit per successful call."
url: https://perceptlayer.com/apis/x/search-tweets
---

[APIs](https://perceptlayer.com/apis) / [X (Twitter)](https://perceptlayer.com/apis/x) / Search Tweets

# X (Twitter): Search Tweets

Search Tweets from X (Twitter) as JSON. 1 credit per successful call.

GET `/v1/x/search-tweets` Needs terms

Note 

This endpoint needs the [restricted-endpoint terms](https://perceptlayer.com/legal/restricted-endpoints), which you can accept in your dashboard.

## Parameters

Send parameters in the query string.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `q` | string | Required | Up to 512 characters |
| `count` | integer | Optional | Any |
| `cursor` | string | Optional | Up to 8,192 characters |
| `lang` | string | Optional | Up to 10 characters |

## Example request

cURL shell 

```
curl "https://api.perceptlayer.com/v1/x/search-tweets?q=nasa" \
  -H "X-API-Key: $API_KEY"
```

[Run this endpoint in the playground](https://perceptlayer.com/apis/x?try=search-tweets#playground) with your own parameters. 1 credit per successful call; failed calls are free.

## Response fields

Each item in `results` has these 21 fields, read from a recorded call. The recording leaves out fields that were empty, so a live call can return more.

| Field | Type |
| --- | --- |
| `type` | string |
| `url` | url |
| `id` | string |
| `text` | string |
| `raw_text` | object |
| `author` | object |
| `replies` | integer |
| `reposts` | integer |
| `likes` | integer |
| `bookmarks` | integer |
| `quotes` | integer |
| `embed_card` | string |
| `created_at` | string |
| `created_timestamp` | integer |
| `possibly_sensitive` | boolean |
| `views` | number |
| `is_note_tweet` | boolean |
| `lang` | string |
| `media` | object |
| `provider` | string |
| `replying_to` | object |
