{"id":23118533,"url":"https://github.com/stefanuros/deno_twitter_api","last_synced_at":"2025-08-16T23:31:37.441Z","repository":{"id":46201007,"uuid":"264573927","full_name":"stefanuros/deno_twitter_api","owner":"stefanuros","description":"A Deno Module to make accessing the Twitter API from Deno a bit easier. ","archived":false,"fork":false,"pushed_at":"2021-11-07T18:03:48.000Z","size":30,"stargazers_count":12,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-12T19:11:42.394Z","etag":null,"topics":["deno","deno-module","module","twitter-api","typescript-library"],"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/stefanuros.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-17T03:13:57.000Z","updated_at":"2023-02-26T14:08:45.000Z","dependencies_parsed_at":"2022-09-08T10:10:54.433Z","dependency_job_id":null,"html_url":"https://github.com/stefanuros/deno_twitter_api","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/stefanuros/deno_twitter_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanuros%2Fdeno_twitter_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanuros%2Fdeno_twitter_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanuros%2Fdeno_twitter_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanuros%2Fdeno_twitter_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanuros","download_url":"https://codeload.github.com/stefanuros/deno_twitter_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanuros%2Fdeno_twitter_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270785575,"owners_count":24644554,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["deno","deno-module","module","twitter-api","typescript-library"],"created_at":"2024-12-17T05:18:11.180Z","updated_at":"2025-08-16T23:31:37.016Z","avatar_url":"https://github.com/stefanuros.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deno Twitter Api\n\nThis module will make accessing the twitter api much easier. You must provide your\nown keys and pass them in, and then this module will handle all of the request \nauthentication. \n\n#### Note\nIt does not handle any user authentication. It only handles application authentication.\n\n## How To Run\nInstall it by including the link to `mod.ts` in the import. There is more detail in `example.ts`.\n`import { TwitterApi } from './mod.ts'`;\n\nRun the example by running `deno run --allow-net example.ts`\nAn example output is listed in `out.txt`\n\n## Making Requests\n`example.ts` shows this in action. The output from `userTimeline` is shown in out.txt.\nTo output this to a file, run `deno run --allow-net example.ts \u003e out.txt`.\n\n`TwitterApi()` takes one parameter, an object with keys from the Twitter developer\nwebsite. They must be in the form\n```typescript\ninterface Keys {\n  consumerApiKey: string,\n  consumerApiSecret: string,\n  accessToken: string,\n  accessTokenSecret: string,\n}\n```\n\nThere are a couple different ways of making requests. These are shown with `userTimeline`\nand `alternativeGet` as well as with `postResult` and `alternativePost`.\n\nThe first parameter of `twitterApi.get()` is the url. This should not include anything \nbefore or including `/1.1/`. Only pass in the url after `/1.1/`. \n\nFor example, if the url is `https://api.twitter.com/1.1/lists/statuses.json`, the parameter \nshould be `lists/statuses.json`\n\nThe optional second parameter is the query parameters. They should follow the form\n```\ninterface Options {\n  [key: string]: string\n}\n```\n\nThe same goes for requests with `twitterApi.request()`. The only difference is that the\nfirst paramter is `GET` or `POST`. The url becomes the second parameter and the\nquery parameters become the third parameter.\n\nIf you are working with the Twitter Ads Api, or the Twitter Developer Labs Endpoint, \nthe baseurl set by default will not work for you. It is set to `https://api.twitter.com/1.1/`\nby default. You can change this by calling `setBaseUrl(\"new url here\");`. This will \nthe url you set when making the call to the twitter api.\n\n## Response\n```json\n[\n  {\n    created_at: \"Mon May 18 02:07:34 +0000 2020\",\n    id: 1262203141157720000,\n    id_str: \"1262203141157720068\",\n    full_text: \"Line 1 Yonge-University: Regular service has resumed southbound at St Andrew.\\nhttps://t.co/464apkmgj...\",\n    truncated: false,\n    display_text_range: [ 0, 101 ],\n    entities: { hashtags: [Array], symbols: [Array], user_mentions: [Array], urls: [Array] },\n    source: \"\u003ca href=\\\"https://www.hootsuite.com\\\" rel=\\\"nofollow\\\"\u003eHootsuite Inc.\u003c/a\u003e\",\n    in_reply_to_status_id: null,\n    in_reply_to_status_id_str: null,\n    in_reply_to_user_id: null,\n    in_reply_to_user_id_str: null,\n    in_reply_to_screen_name: null,\n    user: { id: 19025957, id_str: \"19025957\" },\n    geo: null,\n    coordinates: null,\n    place: null,\n    contributors: null,\n    is_quote_status: true,\n    quoted_status_id: 1262202517313724400,\n    quoted_status_id_str: \"1262202517313724417\",\n    quoted_status_permalink: {\n    url: \"https://t.co/464apkmgjr\",\n    expanded: \"https://twitter.com/TTCnotices/status/1262202517313724417\",\n    display: \"twitter.com/TTCnotices/sta…\"\n    },\n    quoted_status: {\n    created_at: \"Mon May 18 02:05:05 +0000 2020\",\n    id: 1262202517313724400,\n    id_str: \"1262202517313724417\",\n    full_text: \"Line 1 Yonge-University: Delays of up to 15 minutes southbound near St Andrew while we respond to an...\",\n    truncated: false,\n    display_text_range: [Array],\n    entities: [Object],\n    source: \"\u003ca href=\\\"https://www.hootsuite.com\\\" rel=\\\"nofollow\\\"\u003eHootsuite Inc.\u003c/a\u003e\",\n    in_reply_to_status_id: null,\n    in_reply_to_status_id_str: null,\n    in_reply_to_user_id: null,\n    in_reply_to_user_id_str: null,\n    in_reply_to_screen_name: null,\n    user: [Object],\n    geo: null,\n    coordinates: null,\n    place: null,\n    contributors: null,\n    is_quote_status: false,\n    retweet_count: 2,\n    favorite_count: 2,\n    favorited: false,\n    retweeted: false,\n    lang: \"en\"\n    },\n    retweet_count: 2,\n    favorite_count: 0,\n    favorited: false,\n    retweeted: false,\n    possibly_sensitive: false,\n    lang: \"en\"\n  },\n  ...\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanuros%2Fdeno_twitter_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanuros%2Fdeno_twitter_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanuros%2Fdeno_twitter_api/lists"}