Accessing Twitter APIs through Java

java

#1

What is the recommended method of accessing Twitter APIs though Java? I can find few connection libraries:


#2

If you are asking about the Ads API specifically, there’s a Java SDK here based on Twitter4J.

We otherwise would not recommend specific third-party libraries for the broad API, but can talk about which ones we see used most often. For Android, we produce and support our own Twitter Kit. Beyond that, I most commonly see developers using Twitter4J, but that’s not necessarily a personal endorsement as I don’t code Java day-to-day any more!


#3

Thanks @andypiper

Can we access Twitter APIs using curl and not passing the header in the curl.

curl
–get ‘https://api.twitter.com/1.1/search/tweets.json
–data ‘&q=%23archaeology’
–header '‘Authorization: OAuth oauth_consumer_key=“123”, oauth_nonce=“9999”, oauth_signature=“AAAA”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1450742465”, oauth_token=“9999-AAAA”, oauth_version=“1.0”’
–silent

I have Access Token and Access Token Secret, can I use only these and curl to access the Twitter APIs (no header)?


#4

No, the way OAuth works is that you need to build the authentication data in the HTTP headers. There is no alternative to this.