{"id":29092,"date":"2022-07-22T15:33:07","date_gmt":"2022-07-22T15:33:07","guid":{"rendered":"https:\/\/zeru.com\/blog\/?p=29092"},"modified":"2022-07-22T15:33:08","modified_gmt":"2022-07-22T15:33:08","slug":"what-is-twitter-rest-api","status":"publish","type":"post","link":"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api","title":{"rendered":"What is Twitter REST API?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_43 counter-flat ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<p class=\"ez-toc-title\">Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e895df9d02a\" class=\"cssicon\"><span style=\"display: flex;align-items: center;width: 35px;height: 30px;justify-content: center;direction:ltr;\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/label><label for=\"ez-toc-cssicon-toggle-item-69e895df9d02a\"  class=\"cssiconcheckbox\">1<\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e895df9d02a\" ><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api\/#What_is_Twitter_REST_API\" title=\"What is Twitter REST API?\">What is Twitter REST API?<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api\/#Object_model\" title=\"Object model\">Object model<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api\/#HTTP_methods\" title=\"HTTP methods\">HTTP methods<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api\/#Authentication\" title=\"Authentication\">Authentication<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api\/#Limitations\" title=\"Limitations\">Limitations<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api\/#Examples\" title=\"Examples\">Examples<\/a><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"What_is_Twitter_REST_API\"><\/span>What is Twitter REST API?<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p> <img decoding=\"async\" src=\"https:\/\/i.imgur.com\/9HBWStS.jpg\" align=\"left\" alt=\"What is twitter REST API\" style=\"max-width:41% width:auto; margin:0px 10px; height:auto; max-height:286px;\"> <\/p>\n<p>The Twitter REST API is an application that lets users create and manage bookmarks for future reference. There are two endpoints for managing Bookmarks: POST and DELETE. POST creates new Bookmarks, while DELETE deletes them. A user can make up to 50 requests per 15 minutes, and the API does not allow more than that. However, you can still make a bookmark, so long as it&#8217;s created and a unique ID is given to it.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Object_model\"><\/span>Object model<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you are interested in writing your own Twitter REST API applications, the object model of the Twitter API is an important thing to understand. It outlines how to retrieve Twitter data from various sources. For instance, you can retrieve the recent Tweets of a user. But if you are trying to retrieve the latest Tweets of multiple users, this is not an easy task. Here, you will learn how to use Twitter&#8217;s REST API to get the latest tweets from multiple users.<\/p>\n<p>The Twitter REST API offers the ability to get trending topics for locations. The response from Twitter consists of the WOEID, canonical name and country of the location. In addition, you can use the WOEID to search for location-based trending topics. In some cases, you might want to use the place-id to find the exact location of a location. This is a useful feature for users who like to share their location with other people.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"HTTP_methods\"><\/span>HTTP methods<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The HTTP methods of Twitter REST API return an object, Tweet. Each REST response uses the Resource Catalog or One Class model to describe the value returned. If there are multiple tweets to return, an array of objects can be returned. To retrieve tweets, right-click on the REST resource and choose the appropriate HTTP method. Then, select the appropriate object model for the Tweet. You can reuse the Tweet class in your object model.<\/p>\n<p>The Twitter API has two endpoints for bookmarks, POST and DELETE. The POST method will create a new Bookmark, while the DELETE method will delete an existing one. Users should note that the API does not allow them to send multiple updates per day, which can result in a 403 error. Also, users cannot submit the same status more than once in a row. The maximum number of updates a user can send is 50 in 15 minutes.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Authentication\"><\/span>Authentication<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Authentication for Twitter&#8217;s REST API requires the use of an OAuth Authorization header. When a user is authenticated, the API returns data, while if the user is not authenticated, it returns a 200-OK error status code. The purpose of each value in the Authorization header is beyond the scope of this book. For more information, see the OAuth Bible. This book describes the authentication requirements for Twitter&#8217;s REST API.<\/p>\n<p>The authentication process begins with generating an access token for the current user. The application must comply with the Twitter permissions, and it must access both user and consumer tokens. To use the Twitter REST API, you must install a third-party tool that supports OAuth 1.0. Then, use Postman and navigate to the OAuth 1.0 tab. To create an authentication token, choose the consumer token, and then click &#8220;Create Token&#8221; under &#8220;Configuration.&#8221;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Limitations\"><\/span>Limitations<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The new Twitter REST API has some limitations. To ensure that end users experience high quality content, it has imposed content restrictions on Tweets. Tweets that exceed the allowed entities will be rejected via new API error codes. However, the new limitations will apply to all Tweets, not just @mentions. These restrictions will not affect the overall character count of a Tweet. Listed below are the limitations of the new Twitter REST API.<\/p>\n<p>The API supports multiple languages. You can use the dnt parameter to avoid personalization, while the link_color variable adjusts the color of text links in Tweets. Other parameters you can use to limit the amount of data returned by the API include retweeted Tweets. Users can update their status by using these parameters. However, you should use caution when developing applications for the Twitter REST API.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Examples\"><\/span>Examples<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A Twitter REST API response model models the value returned by the server. For example, the API will return an object called a Tweet when you ask for an object named T. This object model can be reused by using the One Class or Many Class option. The Tweet class is easy to reuse in the object model, as you can simply type T and select the name completion list. The Twitter API response model uses the Resource Catalog as the default object model, but you can also use another class to get a broader set of tweets.<\/p>\n<p>If you have a Twitter account, you can use its REST API to tweet to your followers. The URI for this resource is statuses\/update. You can name the Class Diagram whatever you want, but some prefer using the URI \/statuses\/update instead. You can create a Twitter REST API by completing the steps described in the following article. You will need to create an REST Resource and a Class Diagram for your Twitter REST API.<\/p>\n<p> <iframe frameborder=\"0\" width=\"498\" src=\"https:\/\/www.youtube.com\/embed\/ODen7dQCMVg\" height=\"278\" allowfullscreen=\"true\" style=\"margin:0px auto; display: block;\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Twitter REST API? The Twitter REST API is an application that lets users create and manage bookmarks for future reference. There are two endpoints for managing Bookmarks: POST and DELETE. POST creates new Bookmarks, while DELETE deletes them. A user can make up to 50 requests per 15 minutes, and the API does [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":30987,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v19.7 (Yoast SEO v21.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is Twitter REST API? - Zeru<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Twitter REST API?\" \/>\n<meta property=\"og:description\" content=\"What is Twitter REST API? The Twitter REST API is an application that lets users create and manage bookmarks for future reference. There are two endpoints for managing Bookmarks: POST and DELETE. POST creates new Bookmarks, while DELETE deletes them. A user can make up to 50 requests per 15 minutes, and the API does [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api\" \/>\n<meta property=\"og:site_name\" content=\"Zeru\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-22T15:33:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-22T15:33:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/zeru.com\/blog\/wp-content\/uploads\/What-is-Twitter-REST-API_29092.png\" \/>\n\t<meta property=\"og:image:width\" content=\"715\" \/>\n\t<meta property=\"og:image:height\" content=\"493\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Lizzie Yates\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lizzie Yates\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api\",\"url\":\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api\",\"name\":\"What is Twitter REST API? - Zeru\",\"isPartOf\":{\"@id\":\"https:\/\/zeru.com\/blog\/#website\"},\"datePublished\":\"2022-07-22T15:33:07+00:00\",\"dateModified\":\"2022-07-22T15:33:08+00:00\",\"author\":{\"@id\":\"https:\/\/zeru.com\/blog\/#\/schema\/person\/61005d9ec00b94bc50fbaf11b78aa55e\"},\"breadcrumb\":{\"@id\":\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/zeru.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is Twitter REST API?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zeru.com\/blog\/#website\",\"url\":\"https:\/\/zeru.com\/blog\/\",\"name\":\"Zeru\",\"description\":\"Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zeru.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/zeru.com\/blog\/#\/schema\/person\/61005d9ec00b94bc50fbaf11b78aa55e\",\"name\":\"Lizzie Yates\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zeru.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/zeru.com\/blog\/wp-content\/uploads\/19-150x150.jpg\",\"contentUrl\":\"https:\/\/zeru.com\/blog\/wp-content\/uploads\/19-150x150.jpg\",\"caption\":\"Lizzie Yates\"},\"description\":\"A content marketing strategist with the Zeru team for a little over 5 years, Lizzie Yates specializes in everything digital media with a particular focus on social media and technology. Her passion? To follow how the social media sites like Instagram, YouTube, Facebook, Twitter, and TikTok are maturing over time, and what businesses can do to keep up. She shares her insights on our blog in a true outpouring of knowledge and expertise. Her knowledge about technology and social media is vast, and she is always willing to share her insights with businesses to help them stay up-to-date with the latest trends.\",\"url\":\"https:\/\/zeru.com\/blog\/author\/writer\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"What is Twitter REST API? - Zeru","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api","og_locale":"en_US","og_type":"article","og_title":"What is Twitter REST API?","og_description":"What is Twitter REST API? The Twitter REST API is an application that lets users create and manage bookmarks for future reference. There are two endpoints for managing Bookmarks: POST and DELETE. POST creates new Bookmarks, while DELETE deletes them. A user can make up to 50 requests per 15 minutes, and the API does [&hellip;]","og_url":"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api","og_site_name":"Zeru","article_published_time":"2022-07-22T15:33:07+00:00","article_modified_time":"2022-07-22T15:33:08+00:00","og_image":[{"width":715,"height":493,"url":"https:\/\/zeru.com\/blog\/wp-content\/uploads\/What-is-Twitter-REST-API_29092.png","type":"image\/png"}],"author":"Lizzie Yates","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Lizzie Yates","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api","url":"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api","name":"What is Twitter REST API? - Zeru","isPartOf":{"@id":"https:\/\/zeru.com\/blog\/#website"},"datePublished":"2022-07-22T15:33:07+00:00","dateModified":"2022-07-22T15:33:08+00:00","author":{"@id":"https:\/\/zeru.com\/blog\/#\/schema\/person\/61005d9ec00b94bc50fbaf11b78aa55e"},"breadcrumb":{"@id":"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zeru.com\/blog\/what-is-twitter-rest-api"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zeru.com\/blog\/what-is-twitter-rest-api#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zeru.com\/blog"},{"@type":"ListItem","position":2,"name":"What is Twitter REST API?"}]},{"@type":"WebSite","@id":"https:\/\/zeru.com\/blog\/#website","url":"https:\/\/zeru.com\/blog\/","name":"Zeru","description":"Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zeru.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/zeru.com\/blog\/#\/schema\/person\/61005d9ec00b94bc50fbaf11b78aa55e","name":"Lizzie Yates","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zeru.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/zeru.com\/blog\/wp-content\/uploads\/19-150x150.jpg","contentUrl":"https:\/\/zeru.com\/blog\/wp-content\/uploads\/19-150x150.jpg","caption":"Lizzie Yates"},"description":"A content marketing strategist with the Zeru team for a little over 5 years, Lizzie Yates specializes in everything digital media with a particular focus on social media and technology. Her passion? To follow how the social media sites like Instagram, YouTube, Facebook, Twitter, and TikTok are maturing over time, and what businesses can do to keep up. She shares her insights on our blog in a true outpouring of knowledge and expertise. Her knowledge about technology and social media is vast, and she is always willing to share her insights with businesses to help them stay up-to-date with the latest trends.","url":"https:\/\/zeru.com\/blog\/author\/writer"}]}},"_links":{"self":[{"href":"https:\/\/zeru.com\/blog\/wp-json\/wp\/v2\/posts\/29092"}],"collection":[{"href":"https:\/\/zeru.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zeru.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zeru.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/zeru.com\/blog\/wp-json\/wp\/v2\/comments?post=29092"}],"version-history":[{"count":1,"href":"https:\/\/zeru.com\/blog\/wp-json\/wp\/v2\/posts\/29092\/revisions"}],"predecessor-version":[{"id":29093,"href":"https:\/\/zeru.com\/blog\/wp-json\/wp\/v2\/posts\/29092\/revisions\/29093"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zeru.com\/blog\/wp-json\/wp\/v2\/media\/30987"}],"wp:attachment":[{"href":"https:\/\/zeru.com\/blog\/wp-json\/wp\/v2\/media?parent=29092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zeru.com\/blog\/wp-json\/wp\/v2\/categories?post=29092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zeru.com\/blog\/wp-json\/wp\/v2\/tags?post=29092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}