Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8041535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:15:22+00:00 2026-06-05T04:15:22+00:00

I am using YouTube’s api to load current data of videos that users share

  • 0

I am using YouTube’s api to load current data of videos that users share on the site in a feed like Facebook, the thing is that it slows my website down a great amount, it’s about 2-4 seconds per set of data, so if I have one video 2-4 seconds, then 2 videos 4-8 seconds, etc. So my question is is there a way to not retrieve ALL of the data with this, and speed it up more. (I store the title and description of the video in my own database when the user shares it, but other data I can’t. Here’s my code:

 $JSON = file_get_contents("http://gdata.youtube.com/feeds/api/videos?q={$videoID}&alt=json");
 $JSON_Data = json_decode($JSON);
 $ratings = $JSON_Data->{'feed'}->{'entry'}[0]->{'gd$rating'}->{'average'};
 $totalRatings = number_format($JSON_Data->{'feed'}->{'entry'}[0]->{'gd$rating'}->{'numRaters'});
 $views = number_format($JSON_Data->{'feed'}->{'entry'}[0]->{'yt$statistics'}->{'viewCount'});

I also load the thumbnail in, which I may go back to saving the thumbnail on my server on submission, but it doesn’t seem to be what is slowing it down so much, because when I remove it it still takes a long time.

 $thumbnail = "http://img.youtube.com/vi/".$videoID."/2.jpg";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:15:25+00:00Added an answer on June 5, 2026 at 4:15 am

    You can use CURL, file_get_contents ….. its not the point.

    The big point is : CACHE THE RESPONSE !

    Use memcached, file system, data base or whatever but never call API on page load

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to develop a web site where I upload videos using the youtube
We're used to using websites like youtube in full screen, but now Facebook offers
I want to embed some youtube videos at my site using Video.Flash helper. Microsoft.Web.Helpers
I have an application in which I have manually uploaded videos using Youtube Data
I'm using the YouTube API in my flex app to play videos and it
I'm using YouTube's iFrame API to embed videos in a page. Everything works great
I'm currently using YouTube's feed API to get information about a YouTube channel's uploaded
I'm using the youtube api to query by keyword for videos. The result has
Here is some code that uses authentication using YouTube API. Public Function GetService(ByVal username
I wanted to upload a video on youtube using Java Google Data API. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.