# Twitter

> Access Twitter data including user profiles, posts, follower counts, verification status, and engagement metrics.

Source: https://cotera.co/docs/reference/tools/individual-tools/twitter

---

**Authentication Type:** API Key\
**Description:** Access Twitter data including user profiles, posts, follower counts, verification status, and engagement metrics.

***

## Authentication

To authenticate, you'll need a RapidAPI key for the [Twitter API](https://rapidapi.com/davethebeast/api/twitter241).

**Note:** The free plan includes 500 requests per month.

***

## Profile Data

Get detailed Twitter user profile information by username.

### Get Profile

Retrieve a Twitter user profile including follower count, verification status, bio, location, and other public profile information.

**Operation Type:** Query (Read)

**Parameters:**

* **username** `string` (required): Twitter username to retrieve profile for (without @ symbol)

**Returns:**

* **id** `string`: Twitter user ID
* **rest\_id** `string`: REST API user ID
* **is\_blue\_verified** `boolean` (nullable): Whether user has Twitter Blue verification
* **can\_dm** `boolean` (nullable): Whether user can receive direct messages
* **created\_at** `string`: Account creation date
* **default\_profile\_image** `boolean` (nullable): Whether user has default profile image
* **description** `string` (nullable): User bio/description
* **fast\_followers\_count** `number` (nullable): Fast followers count
* **favourites\_count** `number` (nullable): Number of tweets liked
* **followers\_count** `number` (nullable): Number of followers
* **friends\_count** `number` (nullable): Number of accounts following
* **listed\_count** `number` (nullable): Number of lists user is on
* **location** `string` (nullable): User location
* **media\_count** `number` (nullable): Number of media items
* **name** `string`: Display name
* **screen\_name** `string`: Username/handle
* **url** `string` (nullable): User website URL
* **verified** `boolean` (nullable): Legacy verification status
* **birthdate** `object` (nullable): User birthdate information
  * **day** `number` (nullable): Birth day
  * **month** `number` (nullable): Birth month
  * **visibility** `string` (nullable): Birthdate visibility setting
  * **year\_visibility** `string` (nullable): Year visibility setting

**Example Usage:**

```json
{
  "username": "elonmusk"
}
```

***

## User Posts

Get Twitter user posts/tweets by user ID.

### Get Posts

Retrieve a user's recent tweets including text, engagement metrics, view counts, and conversation data.

**Operation Type:** Query (Read)

**Parameters:**

* **user** `string` (required): Twitter user REST ID to retrieve posts for
* **count** `string` (required): Number of posts to retrieve (e.g., "20")

**Returns:**

* **tweets** `array of objects`: Array of tweets
  * **rest\_id** `string`: Tweet REST ID
  * **views** `object` (nullable): Tweet view information
    * **count** `string` (nullable): View count for the tweet
    * **state** `string` (nullable): View state status
  * **legacy** `object` (nullable): Tweet legacy data
    * **bookmark\_count** `number` (nullable): Number of bookmarks
    * **bookmarked** `boolean` (nullable): Whether tweet is bookmarked
    * **created\_at** `string` (nullable): Tweet creation date
    * **conversation\_id\_str** `string` (nullable): Conversation ID
    * **favorite\_count** `number` (nullable): Number of likes
    * **favorited** `boolean` (nullable): Whether tweet is favorited
    * **full\_text** `string` (nullable): Full tweet text
    * **is\_quote\_status** `boolean` (nullable): Whether tweet is a quote
    * **lang** `string` (nullable): Tweet language
    * **quote\_count** `number` (nullable): Number of quotes
    * **reply\_count** `number` (nullable): Number of replies
    * **retweet\_count** `number` (nullable): Number of retweets
    * **retweeted** `boolean` (nullable): Whether tweet is retweeted
    * **user\_id\_str** `string` (nullable): User ID string
    * **id\_str** `string` (nullable): Tweet ID string
    * **in\_reply\_to\_screen\_name** `string` (nullable): Reply to screen name
    * **in\_reply\_to\_status\_id\_str** `string` (nullable): Reply to status ID
    * **in\_reply\_to\_user\_id\_str** `string` (nullable): Reply to user ID
* **cursor** `object` (nullable): Pagination cursor information
  * **bottom** `string` (nullable): Bottom cursor for pagination
  * **top** `string` (nullable): Top cursor for pagination

**Example Usage:**

```json
{
  "user": "44196397",
  "count": "10"
}
```

### Search Tweets

Search Twitter for tweets matching a query. Returns tweet URLs, text, media links, and engagement metrics. Supports filtering by type (Top, Latest, People, Media, Lists).

**Operation Type:** Mutation (Write)

**Parameters:**

* **query** `string` (required): Search query - keywords, hashtags, or phrases
* **type** `string` (default: "Top"): Search type - "Top", "Latest", "People", "Media", or "Lists"
* **count** `number` (default: 20): Number of results to return
* **cursor** `string` (nullable): Pagination cursor from previous response

**Returns:**

* **results** `array of objects`: Array of matching tweets
  * **url** `string`: URL to the tweet
  * **username** `string`: Twitter handle of the author
  * **text** `string` (nullable): Tweet text content
  * **mediaLinks** `array of strings` (nullable): URLs to media attachments (images, videos)
  * **engagement** `object`: Engagement metrics
    * **views** `number` (nullable): Number of views
    * **likes** `number` (nullable): Number of likes
    * **retweets** `number` (nullable): Number of retweets
    * **replies** `number` (nullable): Number of replies
    * **bookmarks** `number` (nullable): Number of bookmarks
  * **createdAt** `string` (nullable): Tweet creation timestamp
* **cursor** `string` (nullable): Cursor for fetching the next page of results

**Example Usage:**

```json
{
  "query": "artificial intelligence",
  "type": "Latest",
  "count": 20
}
```

***

## Common Use Cases

**Profile Analysis:**

* Analyze user engagement patterns and follower growth
* Track verification status and account authenticity
* Research user demographics and interests

**Content Monitoring:**

* Track tweet performance and engagement metrics
* Monitor user posting patterns and frequency
* Analyze tweet content and conversation threads
* Search for tweets mentioning your brand or competitors

**Social Media Research:**

* Study user behavior and engagement on Twitter
* Analyze tweet performance across different topics
* Track user influence and reach metrics
* Search for trending topics and conversations

**Trend Analysis:**

* Search for tweets about specific topics or hashtags
* Monitor real-time discussions and breaking news
* Track sentiment around products, events, or brands
* Discover influencers and thought leaders in your industry

