Getting Started with the Twitter API | Docs - Twitter Developer

文章推薦指數: 80 %
投票人數:10人

The Twitter API can be used to programmatically retrieve and analyze Twitter data, as well as build for the conversation on Twitter. Over the years, the Twitter ... Gettingstarted AbouttheTwitterAPI GettingaccesstotheTwitterAPI Makeyourfirstrequest Importantresources AbouttheTwitterAPI TheTwitterAPIcanbeusedtoprogrammaticallyretrieveandanalyzeTwitterdata,aswellasbuildfortheconversationonTwitter. Overtheyears,theTwitterAPIhasgrownbyaddingadditionallevelsofaccessfordevelopersandacademicresearcherstobeabletoscaletheiraccesstoenhanceandresearchthepublicconversation.  Recently,wereleasedtheTwitterAPIv2.TheTwitterAPIv2includesamodernfoundation,newandadvancedfeatures,andquickonboardingtoEssentialaccess.  ThefollowingthreetabsexplainthedifferentversionsandaccesslevelsoftheTwitterAPI,what’snewwithv2,andwhichTwitterresourcesyoucanretrieve,create,destroy,andadjustusingtheAPI.  Accesslevelsandversions What'snewwithv2 TwitterAPIresources Accesslevelsandversions What'snewwithv2 TwitterAPIresources TwitterAPIaccesslevelsandversions WhiletheTwitterAPIv2istheprimaryTwitterAPI,theplatformcurrentlysupportspreviousversions(v1.1,Gnip2.0)aswell.Werecommendthatallusersstartwithv2asthisiswhereallfutureinnovationwillhappen.  TheTwitterAPIv2includesafewaccesslevelstohelpyouscaleyourusageontheplatform.Ingeneral,newaccountscanquicklysignupforfree,Essentialaccess.Shouldyouwantadditionalaccess,youmaychoosetoapplyforfreeElevatedaccessandbeyond.      Essential Elevated Elevated+ (comingsoon) AcademicResearch Gettingaccess Signup Applyforadditionalaccesswithinthedeveloperportal Needmore? Signupforourwaitlist Applyforadditionalaccess Price Free Free Free AccesstoTwitterAPIv2 ✔️ ✔️ ✔️ Accesstostandardv1.1 ✔️(Limitedaccess-onlymediaendpoints) ✔️ ✔️ Accesstopremiumv1.1 ❌ ✔️ ✔️ Accesstoenterprise ❌ ✔️ ✔️ Projectlimits 1Project 1Project 1Project Applimits 1AppperProject 3AppsperProject 1AppperProject Tweetcaps Retrieveupto500kTweetspermonth Retrieveupto2millionTweetspermonth Retrieveupto10millionTweetspermonth Filteredstreamrulelimit 5rules 25rules 1000rules Filteredstream rulelength 512characters 512characters 1024characters FilteredstreamPOSTrulesratelimit 25requestsper15minutes 50requestsper15minutes 100requestsper15minutes SearchTweetsquerylength 512characters 512characters 1024characters Accesstofull-archivesearchTweets ❌ ❌ ✔️ Accesstofull-archiveTweetcounts ❌ ❌ ✔️ Accesstoadvancedfilteroperators ❌ ❌ ✔️ Optionto manageateaminthedeveloperportal ❌ ✔️(Requiresanorganizationtypeaccount) ❌ AccesstotheAdsAPI ✔️(Requiresadditional application) ✔️(Requiresadditionalapplication) ❌   Pleasenote: IfyouwereapprovedforadeveloperaccountbeforeNovember15th,2021,youwereautomaticallyconvertedtoElevatedaccess.ThismeansthatyourexistingAppscancontinuetobeusedtomakerequeststostandardv1.1,premiumv1.1,andenterpriseendpoints,andthatallofyouruserAccessTokensarestillvalid. Ifyouwouldliketostartusingv2endpoints,youwillneedtoattachanApptoaProjectandusethecredentialsfromthatAppwhenmakingrequeststov2endpoints.    OtherTwitterAPIofferings EnterpriseAPIs(FormerlyGnip2.0) Enterprise-levelproductsthatprovideaccesstoTwitter’sdata,including FullArchiveand30DaySearchAPI, PowerTrackAPI, HistoricalPowerTrackAPI, DecahoseAPI, EngagementAPI,andmuchmore! Learnmore   Premiumv1.1 Thepremiumv1.1endpointsofferscalableaccesstoTwitterdataforthoselookingtousetheSearchAPI,orsubscribetoandreceiveavarietyofdifferentuseractivitiesusingtheAccountActivityAPI. Learnmore   Standardv1.1 Thestandardv1.1endpointswerelaunchedin2012andenableyoutopost,interact,andretrievedataforresourcessuchasTweets,Users,DirectMessages,Lists,Trends,Media,andPlaces. Learnmore MigratetoTwitterAPIv2 InterestedinmigratingyourcurrentintegrationtoTwitterAPIv2?Checkoutourmigrationhubforresourcesthatwillhelpyouunderstandwhatisdifferentbetweenv2andpreviousversions,includingthedataformats.Youcanalsoaccessmigrationguidesforeachendpointlistedinthenewv2endpointsections.   Learnmore TwitterAPIendpointmap What'snewwithv2 TheTwitterAPIv2representsthelargestupgradeoftheTwitterAPIsince2012.Withitcomesahostofnewandadvancedfeatures,aswellasfastandfreeaccesstotheAPI.  Someofthefeaturesthatareavailablewithv2includethefollowing: Newendpoints Wehavereleasedasetofnet-newendpointstoTwitterAPIv2.Youcanseeafulllistofv2endpoints,includingthosethatarenew,onourTwitterAPIendpointmapguide. VisittheTwitterAPIendpointmap> Newandmoredetaileddataobjects We'vemodernizedourdataobjectswithavarietyoffnewimprovementsthatwillenableyoutomoreeasilynavigateandparsedata. Visitthedatadictionary>    Newparameterstohelpyouretrievejustthoseobjectsandfieldsthatyouwant We’veaddedfieldsandexpansionsparameterstoourdataendpointsthatallowyoutorequestrelatedobjectsandfieldsbeyondthosefieldsthatreturnbydefault. Learnhowtousefieldsandexpansions>   Advancedmetrics MoreeasilyunderstandtheperformanceofTweets,users,media,andpollsfromdirectlywithinyourpayloadbyrequestingbothpublicandprivatemetricsincludingimpressions,videoviews,userprofile,andURLclicks,someofwhichareseparatedintoanorganicandpromotedcontext. Learnmoreaboutmetrics>   FilteronandidentifywhichTweetscontaindifferenttopics WhenusingsearchTweetsorfilteredstream,youcannowfilterbytopicusingourentityandcontextoperators.We’vealsoprovidedthesetopicswithintheTweetpayloadtohelpwithanalysis.  LearnmoreaboutTweetannotations>   FIlteronandidentifywhichTweetsbelongtoareplythread MakeiteasiertoidentifyaTweetaspartofaconversationthreadwhenusingsearchTweets,filteredstream,andTweetlookup.We'vealsoaddedtheabilitytodeterminewhetherconversationreplysettingshavebeensetforaTweetwiththeTweetfieldreply_settings. Learnmoreaboutconversationtracking>   AspecificaccesslevelforAcademicResearchers Thisspecializedaccesslevelforresearchersgrantsfreeaccesstofull-archivesearch,full-archiveTweetcounts,andotherv2endpointsreleasedtodate.ItalsoincludesasignificantlyhighermonthlyTweetcap,andenhancedfeaturesandfunctionalitytogetmorepreciseandcompletedataforanalyzingthepublicconversation. LearnmoreaboutAcademicResearchaccess>   Andsomuchmore... Highconfidencespamfiltering ShortenedURLsarefullyunwoundforeasierURLanalysis SimplifiedJSONresponseobjectsbyremovingdeprecatedfieldsandmodernizinglabels Recoveryandredundancyfunctionalityforourstreamingendpoints Returnof100%ofmatchingpublicandavailableTweetsinsearchqueries Streaming"rules"soyoucanmakechangeswithoutdroppingconnections Moreexpressivequerylanguageforfilteredstreamandsearch OpenAPIspectobuildnewlibraries&moretransparentlytrackchanges APIsupportfornewfeaturesandendpointsmorequicklyasourplatformevolvestomeettheneedsofdevelopers,researchers,businesses,andpeopleusingTwitter TwitterAPIplatformresources IntheAPIdesignspace,aresourceisanentitywithassociateddata,relationshipstootherresources,andasetofmethodsthatoperateonit.Forexample,aTweetisaresourcethatyoucancreate,delete,orretrieveusingavarietyofdifferenttools,suchashistoricallysearchingforthem,orretrievingtheminreal-time.  TheTwitterAPIprovidesaccesstocreate,delete,receive,oradjustavarietyofdifferentresourcesontheplatformincludingthefollowing:   Resource Description Tweets TapintomillionsofTweetstounderstandthepublicconversation,orcreateyourowntoengagewiththeconversation. Currentavailability: TwitterAPIv2 Enterprise Premiumv1.1 Standardv1.1 Users ManageorlookupTwitteruserstoanalyzenetworks,understandyouraudience,orfosterpositiveonlinerelationships. Currentavailability: TwitterAPIv2 Enterprise Premiumv1.1 Standardv1.1 Spaces LookupandsearchTwitterSpacesandtheirattendeestohelppeoplefindinterestingandrelevantaudioconversations. Currentavailability: TwitterAPIv2 DirectMessages SendandreceiveDirectMessagestotriagecustomerissues,sendwelcomemessages,orcreatepositivehumaninteraction. Currentavailability: Standardv1.1 Lists Curateandmanagelistsofaccountstokeepapulseonindustryexperts,powerfulvoices,ororganizewhoyoufollow. Currentavailability: TwitterAPIv2 Standardv1.1 Trends Identifygeographictrendsfirsttopinpointindustrymovement,discoverhottopics,orstayaheadofthelatestfad. Currentavailability: Standardv1.1 Media Uploadmediaobjectstoshareyourcreativeenergy,createinteractiveexperiences,orbuildaccessibilitytools. Currentavailability: Standardv1.1 Places Searchforplacestounderstandwhat’shappeninginyourneighborhoodandaroundtheworld. Currentavailability: Standardv1.1 Nextsteps YoucansignupfortheTwitterAPI,orreviewourGettingaccesstotheTwitterAPIguideformoredetails. We’vealsoputtogetheraguidedescribinghowtomakeyourfirstrequesttotheTwitterAPI.  Ifyouhaveanyfeedbackonthesegettingstartedresources,we’dlovetohearfromyou! Pleasefilloutthebriefsurveyatthebottomofeachpagetohelpusimprove.  ByusingTwitter’sservicesyouagreetoourCookiesUse.Weusecookiesforpurposesincludinganalytics,personalisation,andads. OK ThispageandcertainotherTwittersitesplaceandreadthirdpartycookiesonyourbrowserthatareusedfornon-essentialpurposesincludingtargetingofads. Throughthesecookies,Google,LinkedInandDemandbasecollectpersonaldataaboutyoufortheirownpurposes. Learnmore. Accept Decline



請為這篇文章評分?