Twitter Ads API SDK (twitter4j-ads) for Java Now Available!



Now Available! twitter4j-ads for Java

Hi All,

Twitter4j-ads is a stable and well tested Java SDK for Twitter’s Ads API, originally developed and then open sourced by one of the top social media companies building upon the Ads API (Sprinklr).

You’re welcome if you want to collaborate!

Project Homepage:

Have a question? Need to report an issue?


Can any one explain briefly about how to use ads api in initial stage and how can i give request to access analytics data
Does the ads api can only fetch the twitter ads accounts analytics? or it can also fetch normal user account analytics

Good Job!!!


Great work to the team at Sprinklr for helping to open source this Ads API Java SDK!


Thanks John and team for the support.


Awesome, thanks for sharing this with the community! :fist:


Thank you so much team Sprinklr for making this available and doing such a solid job on it!


Love this, can’t wait to see adoption grow!


Is there a .jar file anywhere so this can be easily integrated into a current Java web application?

Twitter4J Ads API Jar File for Java Web Application?

is there any jar and example program available somewhere


Hi folks, FYI there will be new updates released to this SDK relatively soon. Please keep your eyes out for those.

The jar can be found from but since the SDK is still in an early state I highly recommend to participate in the community around this SDK at (to make it successful in a true open source sense!).




Just had a play with the Jar file. Buggy as hell. Can’t even get past the initial sample code on GitHub for listing all Campaigns within an account. The Javadoc is useless. I was full of hope when the .jar file came out and left disappointed (again). Sorry to be so negative, but seriously, this should just work. I’ll give this another try when v.2.0 comes out when all the bugs have been ironed out and the documentation is better. It’s a shame.


I don’t think that a company, with its own goals, had made the effort to release an project as opensource is a shame

For sure for them it had taken a lot of time.

Please be more respectfull with others work.


I’m not criticizing the guys who built this, good on to them for open sourcing this. As you have mentioned though, they are a company have their own goals, of which supporting the Twitter API is likely at the bottom of this list. My gripe here is that Twitter is not leading this internally and putting the resources behind this as a company that is needed. Flying the flag of open source is simply showing that Twitter isn’t committed to developing the Ads API and isn’t willing to put any resources behind it and simply wants other people to build a direct revenue model for Twitter. It’s a joke. This isn’t just me whining about this, I want this to be taken on board and I want to see Twitter put some serious resources behind this. I’m sat here running a technology company and have tried on multiple occasions to integrate the Twitter Ads API into our platform and have simply given up as it’s just a pain to work with.


@MickCropper can you elaborate on this a little please, we would be happy to help you out, we can connect and get all the challenges you are facing integrating the Jar


@MickCropper lets get past this and think of it as a bad start, being one of the contributors i will be happy to help you integrate the same and make any changes as suggested, the Twitter staff/company is not to blame on this, they gave us their full support and whatever ends are loose we need to address them


Thanks for the help @abhishek_pyro appreciate it. What’s the best route here? Report bugs on GitHub? Or drop you an email?


@MickCropper yes you can drop me an email on with all the details, also just to confirm did you try running the test given in the examples package, since you mentioned getting all campaigns, the details need to be provided in the ConfigurationBuilder (present in the BaseAdsTest Class, App related info), did it not fetch the campaigns even then?


Thanks @abhishek_pyro I’ll drop you an email with full details. Not managed to build the code samples even with various configurations.


@MickCropper just got your mail, starting a thread to resolve this conversation


Thanks @abhishek_pyro issue resolved. There are a couple of dependencies that need adding into your project for anyone else who is having issues. Make sure you import the google-collections.jar file and also guava-19.0.jar. Documentation is being updated to include this information for future use too.