Google Custom Search Quota Hit: Site Restricted Queries per user per 100 seconds - api

I'm hitting the 100 seconds per user site restricted google custom search quota. I have unlimited queries plan and am getting billed. I don't pass in the userId so I'm not sure how it's limiting me. From the console I see the site restricted rate as 100 per user per 100 seconds. Can I just feed in random strings as the user id to help solve this? I've read the docs and they're not useful and have found other people ask this without an answer.
Help would be appreciated!
Thank you

If you don't pass a user ID, then all of your queries are considered to be coming from a single user.
Passing a user ID with your requests will apply the capping correctly per user.
See the "Capping API Usage" doc for more info.

Related

Google Plus API Sign-in Query 20 Millions Quota

So, Google Plus promised 20 million of requests per day for sign-in queries. I currently only get 20000 query per day. I don't understand what is the difference between normal query and sign-in query. Can anybody explain?
Thanks,
Ami
Methods that are allowed by the https://www.googleapis.com/auth/plus.login scope, such as people.get and people.list, count against the "Sign-in queries" quota. All others count against the general "Queries" quota. See this page for details.

Fetch Past Tweets within Particular Time Period -- Twitter Streaming API

I am working on a little app which will give an option to the user to select From and To dates and the app will return tweets they had in the particular time span.
Twitter is offering User Stream API that returns 200 records per request. My account has 6790 tweets and I need to calculate their favorite and retweets.
6790 will result approx 33 requests if I go for all tweets and how much time will it take? Further, will it cause some issue due to twitter rate-limit?
If somebody can please guide me on how can I fetch the data?
Thanks
You don't need to stream for this.
If you want to get the user's favourites, use the favorites/list
For example, to get my favourites, call
https://api.twitter.com/1.1/favorites/list.json?screen_name=edent&count=200
If the user has authenticated with you, it's easy to get their retweets with statuses/retweets_of_me

Twitter API limits

I made a website like wefollow.com. And I was using Abraham Williams (abrah.am)'s class to update user data(followers and tweets) every night. But after Twitter changed API limits I'm kind of stuck.
I'm limited to 150 or 200 requests for an hour. Which was 10,000 before. How can I update user data with these limits. Or is there any other class to solve this problem.
Thank you!
You could cache it on your server, or pipe it through YQL and then set the _maxage parameter sufficiently so it won't hit the Twitter API limit.
YQL has a 100,000 calls a day limit.
Its 150 for unauthenticated users, and 350 for authenticated users. I don't think you can bypass this. Twitter was previously offering clients to be whitelisted (gets 30,000 requests per hour), but now they've removed that privilege.
So you're stuck with 350 x 24 requests per day. Its not a matter of changing libraries.

I need a creative way to access followers using the Twitter API for 10,000 usernames or more without hitting rate limits, in Ruby on Rails 3

How do I access the number of followers a user has on Twitter for 10,000 usernames or more each day?
Needless to say this hits the rate limit. I was told there are creative ways to avoid the limit, but I can't find any. I also don't want to use or can't use authentication of users. I need to do it as an anonymous server.
Give GET users/lookup a try. It lets you get user objects for 100 users in a single request. 10000 users / 100 user/request = 100 requests which will be easy to do in an hour let alone all day.

Twitter API for searching a user's friends?

I'm working on an app that allows users to search for a particular friend on Twitter (and eventually Facebook) and then send them a message (sort of).
My problem is, the API limits me to only getting 100 friends per request. For a user with a lot of friends, this could take many requests (even if I cache it) and will make my app hit the rate limit pretty quickly.
Is there an official (or unofficial) Twitter API for searching for only your friends?
The solution I have implemented for now is this: whenever a user logs in, iterate through each 100 block of friends and put them in the Rails.cache. They stay there until the user logs out and logs back in. Now that I know that the API requests are counted against the logged in user, I shouldn't need to worry about hitting the rate limit API since each user will have 350 requests per hour.
However, I have found a few problems with this, and I have a few thoughts on solutions:
Problem: We are storing a large amount of data to cache someone's friends.
Solution: It would be best if we could cache all twitter users who are friends of one of our users in one object (or hash) and also cache only the IDs of the friends for each user (which can be grabbed with far less API calls). This would create a bit of a slowdown, but would be far less storage required. Then, whenever a user logs in, we would simply update the global friend cache with any changes (i.e. picture, name, etc.).
Problem: My application still has to store this and figure out how to parse it; it's not very organized.
Solution: Extract this functionality into a new application that creates a better API for searching. If I accomplish this, I'll post an update here with a link.