There are two types of Application Programming Interfaces (API) available (REST and Streaming). See documentation on developer.twitter.com However, sometimes for large requests you have to be aware of limitations per request.
Firstly, if you want to get data from Twitter, you need a developer account on Twitter. You can use the "rtweet" which is a package in R for getting data from Twitter. Moreover, if you need data in a network form, you can use Gephi which is a free tool for network analysis. There is a plugin called "Twitter Streaming Importer" for getting data from Twitter as a network form.