{"id":13901351,"url":"https://github.com/FeedHive/twitter-api-client","last_synced_at":"2025-07-17T21:33:03.734Z","repository":{"id":41111796,"uuid":"281412830","full_name":"FeedHive/twitter-api-client","owner":"FeedHive","description":"A user-friendly Node.js / JavaScript client library for interacting with the Twitter API.","archived":true,"fork":false,"pushed_at":"2022-08-20T08:46:08.000Z","size":762,"stargazers_count":947,"open_issues_count":17,"forks_count":84,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-06-15T04:48:59.059Z","etag":null,"topics":["api-client","nodejs","twitter-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FeedHive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-21T13:58:56.000Z","updated_at":"2025-06-01T12:15:01.000Z","dependencies_parsed_at":"2022-07-14T23:46:11.842Z","dependency_job_id":null,"html_url":"https://github.com/FeedHive/twitter-api-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FeedHive/twitter-api-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FeedHive%2Ftwitter-api-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FeedHive%2Ftwitter-api-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FeedHive%2Ftwitter-api-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FeedHive%2Ftwitter-api-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FeedHive","download_url":"https://codeload.github.com/FeedHive/twitter-api-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FeedHive%2Ftwitter-api-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265521612,"owners_count":23781542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","nodejs","twitter-api"],"created_at":"2024-08-06T21:01:14.977Z","updated_at":"2025-07-17T21:33:02.956Z","avatar_url":"https://github.com/FeedHive.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Twitter API Client\n\nNode.js client for Twitter API\n\n![](https://i.imgur.com/NfnLHIM.png)\n\n[![NPM Version](https://img.shields.io/npm/v/twitter-api-client)](https://www.npmjs.com/package/twitter-api-client)\n![Build Status](https://github.com/FeedHive/twitter-api-client/workflows/build/badge.svg)\n\n### ⚠️ Important notice\n\nTwitter now has an [official TypeScript SDK](https://github.com/twitterdev/twitter-api-typescript-sdk).  \nWe recommend using that instead of this client.\n\nThis project will be maintained, but will not be developed any further.\n\nTo all contributors who added to this project: Thank you 🧡\n\n## Table of content\n\n- [Features](#features)\n- [**Getting Started**](#getting-started)\n- [Usage](#usage)\n- [License](#license)\n- [Get Help](#get-help)\n- [Contribute](#contribute)\n\n## Features\n\n☑️ Includes 90% of the **official Twitter API** endpoints.  \n☑️ **Promise-based!** No ugly callbacks.  \n☑️ **Fully typed!** Both for query parameters and responses.  \n☑️ Inbuilt in-memory **cache** for rate-limit friendly usage.\n\n## Getting Started\n\n### Get your Twitter credentials\n\nYou will need to create a set of Twitter developer credentials from your Twitter Developer account.  \nIf you don't have one already, apply for a developer account [here](https://developer.twitter.com/).  \nIt takes about 5 minutes.\n\n### Install\n\n```console\nnpm i twitter-api-client\n```\n\n## Usage\n\n```javascript\nimport { TwitterClient } from 'twitter-api-client';\n\nconst twitterClient = new TwitterClient({\n  apiKey: '\u003cYOUR-TWITTER-API-KEY\u003e',\n  apiSecret: '\u003cYOUR-TWITTER-API-SECRET\u003e',\n  accessToken: '\u003cYOUR-TWITTER-ACCESS-TOKEN\u003e',\n  accessTokenSecret: '\u003cYOUR-TWITTER-ACCESS-TOKEN-SECRET\u003e',\n});\n\n// Search for a user\nconst data = await twitterClient.accountsAndUsers.usersSearch({ q: 'twitterDev' });\n\n// Get message event by Id\nconst data = await twitterClient.directMessages.eventsShow({ id: '1234' });\n\n// Get most recent 25 retweets of a tweet\nconst data = await twitterClient.tweets.statusesRetweetsById({ id: '12345', count: 25 });\n\n// Get local trends\nconst data = await twitterClient.trends.trendsAvailable();\n```\n\n[See all available methods here](https://github.com/FeedHive/twitter-api-client/blob/main/REFERENCES.md).\n\n### Configuration\n\n`twitter-api-client` comes with an inbuilt in-memory cache.  \nThe stale data is served by the cache-first principle.\n\nYou can configure the caching behavior upon instantiation of the client:\n\n```javascript\nconst twitterClient = new TwitterClient({\n  apiKey: '\u003cYOUR-TWITTER-API-KEY\u003e',\n  apiSecret: '\u003cYOUR-TWITTER-API-SECRET\u003e',\n  accessToken: '\u003cYOUR-TWITTER-ACCESS-TOKEN\u003e',\n  accessTokenSecret: '\u003cYOUR-TWITTER-ACCESS-TOKEN-SECRET\u003e',\n  ttl: 120, // seconds. Defaults to 360\n  disableCache: true, // Disables the caching behavior. Defaults to 'false'\n  maxByteSize: 32000000, // Maximum (approximated) memory size for cache store. Defaults to 16000000.\n});\n```\n\n## License\n\nThis project is licensed under the [MIT License](https://github.com/Silind/twitter-api-client/blob/main/LICENSE)\n\n## Get Help\n\n- Reach out on [Twitter](https://twitter.com/SimonHoiberg)\n- Open an [issue on GitHub](https://github.com/Silind/twitter-api-client/issues/new)\n\n## Contribute\n\n#### Issues\n\nIn the case of a bug report, bugfix or a suggestions, please feel very free to open an issue.\n\n#### Pull request\n\nPull requests are always welcome, and I'll do my best to do reviews as fast as I can.\nPlease refer to the [contribution guide](https://github.com/Silind/twitter-api-client/blob/main/CONTRIBUTING.md) to see how to get started.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFeedHive%2Ftwitter-api-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFeedHive%2Ftwitter-api-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFeedHive%2Ftwitter-api-client/lists"}