The bill would ban TikTok in the United States if its owner ByteDance fails to divest the app over the next nine months
Twitter did not disclose the price it paid for Gnip.
"Together we plan to offer more sophisticated data sets and better data enrichments, so that even more developers and businesses big and small around the world can drive innovation using the unique content that is shared on Twitter," the microblogging company said in a blog.
Founded in 2008, Gnip has a four-year-old partnership with Twitter and helps companies analyse data across every public tweet.
Gnip also has partnerships with other social media companies such as Tumblr, WordPress, Foursquare, Disqus, IntenseDebate, StockTwits and GetGlue.
Twitter's shares were little changed at $41.02 in late morning trading on the New York Stock Exchange.