{"id":28192904,"url":"https://github.com/dcspark/twttrapi-middleware","last_synced_at":"2026-02-21T09:02:33.643Z","repository":{"id":287427278,"uuid":"960114205","full_name":"dcSpark/twttrapi-middleware","owner":"dcSpark","description":"Middleware to simplify RapidAPI TwttrAPI responses.","archived":false,"fork":false,"pushed_at":"2025-04-11T16:35:36.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T17:43:34.584Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcSpark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-03T22:07:58.000Z","updated_at":"2025-04-11T16:35:40.000Z","dependencies_parsed_at":"2025-04-11T17:43:41.363Z","dependency_job_id":"fc6ec9dd-9b3e-4921-a3f0-353dd5e36bca","html_url":"https://github.com/dcSpark/twttrapi-middleware","commit_stats":null,"previous_names":["dcspark/twttrapi-middleware"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcSpark%2Ftwttrapi-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcSpark%2Ftwttrapi-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcSpark%2Ftwttrapi-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcSpark%2Ftwttrapi-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcSpark","download_url":"https://codeload.github.com/dcSpark/twttrapi-middleware/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254527099,"owners_count":22085920,"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":[],"created_at":"2025-05-16T12:15:44.535Z","updated_at":"2025-05-16T12:16:03.184Z","avatar_url":"https://github.com/dcSpark.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# twttrapi-middleware\n\nA Node.js module to interact with the Twitter API via RapidAPI's twttrapi service. This middleware provides a simplified interface for accessing Twitter data without directly using the official Twitter API.\n\n## Features\n\n- Get tweet by ID\n- Get user tweets, replies, and media\n- Search tweets (latest and top results)\n- Search users\n- Get user profile information\n- Get user followers and following lists\n\n## Installation\n\n```bash\nnpm install twttrapi-middleware\n```\n\n## Requirements\n\nYou need a RapidAPI key with access to the twttrapi service. Sign up at [RapidAPI](https://rapidapi.com) and subscribe to the [twttrapi](https://rapidapi.com/twttrapi/api/twttrapi) service.\n\n## Usage\n\n```typescript\nimport TwttrApi from \"twttrapi-middleware\";\n\n// Initialize with your RapidAPI key\nconst twttr = new TwttrApi('your-rapidapi-key', true); // Second parameter enables debug mode\n\n// Example: Get a tweet by ID\ntwttr.getTweetById('1907254694163980405')\n  .then(tweet =\u003e console.log(tweet))\n  .catch(error =\u003e console.error(error));\n\n// Example: Get a user's tweets\ntwttr.getUserTweets('username')\n  .then(tweets =\u003e console.log(tweets))\n  .catch(error =\u003e console.error(error));\n```\n\n## API Reference\n\n### Constructor\n\n```typescript\nnew TwttrApi(rapidapiKey: string, debug: boolean = false)\n```\n\n- `rapidapiKey`: Your RapidAPI key\n- `debug`: Optional boolean to enable debug mode (defaults to false)\n\n### Methods\n\nAll methods return a Promise that resolves to the requested data or an error response.\n\n- `getTweetById(id: string)`: Get a tweet by its ID\n- `getUserTweets(username: string)`: Get tweets from a user\n- `getUserReplies(username: string)`: Get replies from a user\n- `getUserMedia(username: string)`: Get media tweets from a user\n- `searchTop(query: string)`: Search top tweets for a query\n- `searchLatest(query: string)`: Search latest tweets for a query\n- `searchUsers(query: string)`: Search users by query\n- `getUser(username: string)`: Get a user's profile information\n- `getUserFollowers(username: string)`: Get a user's followers\n- `getUserFollowing(username: string)`: Get accounts a user is following\n\n## Response Types\n\nThe module primarily returns `Tweet`, `User`, and `Media` objects or `ErrorResponse` if an error occurs.\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n\n# Run tests\nnpm test\n\n# Run in development mode\nnpm run dev\n```\n\n## License\n\nMIT © [dcSpark](https://dcspark.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcspark%2Ftwttrapi-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcspark%2Ftwttrapi-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcspark%2Ftwttrapi-middleware/lists"}