Search code examples
phplaravelgmail-apigmail-imap

Gmail API - Massive Requests


I have a platform that get user's email and search for an attachment bringing it to platform and show to the users. But the users need to send it to a specific email and we search in this email the files of their emails. But now I want to make it "better" to them. Working automatically...

I have a database with many clients and now I want to provide a smart solution to them by:

  • Get the files from their emails automatically and put all of them on the platform. (they will make an authentication using their email provider account(gmail))

  • So it will be a lot of requests. Because I need search on their emails the exactly email that contains the file of the platform need.

  • When the user "requests" an update, I will search only in the news emails, based on the last update date.

So to summarize:

  • Use gmail authentication to get authorization to search for "specific files(.csv) in user's emails."

  • Make a millions of requests(one request for each user to search this file on their emails) by day to Gmail API.

  • Save those data on my server and after provide those data to the users in Android device.

I want to implement that, but I don't know if I need to register or make something before(such as special register on Google) to create this solution.


Solution

  • Google Gmail Api provides pretty high amount of request for free.

    Daily Usage 1,000,000,000 quota units per day

    Per User Rate Limit 250 quota units per user per second

    Google Gmail Api Reference

    I bet this amount can handle quite a lot.

    And as you said, you might be pulling a lot of attachments, which every request of getting attachment, will cost you 5 quota unit. With this being provided, you can pull 200,000,000 attachments per day.

    I think Gmail API is not "billable" as of now. But you probably can request more if the provided amount will not suffice your need.