Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3638

How is it possible that my app reaches the daily 10,000 query quota on the google youtube api?

$
0
0

So in my google developer console it says that I reached the 10,000 queries quota after a few hours of coding my app, how is this possible? My app is a youtube clone which uses only 3 calls each time it is run, for the 3 home/trending/subscription feeds, and another call which is used when you search for something.

I'm going to give you my cellForItemAt part that calls these functions. If you want to see all the functions I can give you the git link since my app is split into data layer/domain layer/ ui layer which makes it quite a long path to the JSONdecoder function which is a simple completion handler that returns an array of videos. Also I know the functions get called every time I slide the collection view but i really don't slide it that much while using it, and previously I used to call the fetch functions in viewdidload and I still reached the daily quota, although after 3 hours.

I have already tried using only one call while making the app and I still managed to reach the quota pretty fast. I do test the app a lot, but i doubt that I run it over 30 or 40 times per hour...

EDIT: Haha I figured it out, collectionView.reloadData() kept calling the functions over and over again, i just got a new api key and let it run for literally 30 seconds and api calls are up to 4000. Haha, I'm laughing so much now, thanks for the replies!

        if indexPath.row == 3{            let cell = collectionView.dequeueReusableCell(withReuseIdentifier: accountCellId, for: indexPath)            guard let accountCell = cell as? AccountCell else {return cell}            return accountCell        }        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath)        guard let feedCell = cell as? SlidingVideoFeedCell else {return cell}        switch indexPath.row {        case 0:            fetchHome()            feedCell.setUpViews(videos: videoFeeds["home"], images: images)        case 1:            fetchTrending()            feedCell.setUpViews(videos: videoFeeds["trending"], images: images)        case 2:            fetchSubscription()            feedCell.setUpViews(videos: videoFeeds["subscription"], images: images)        default:            print("out of range")        }            return feedCell        }

Viewing all articles
Browse latest Browse all 3638

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>