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 8477525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:29:28+00:00 2026-06-10T18:29:28+00:00

I’m retrieving large amounts of data from Youtube (users and videos) via their API,

  • 0

I’m retrieving large amounts of data from Youtube (users and videos) via their API, but it is getting slower and slower because my needs are incresing trough the time and the requests apparently must be made individually:

http://gdata.youtube.com/feeds/api/users/ID
https://gdata.youtube.com/feeds/api/videos/ID

So I decided to give a try to the batch processing, were you can “theoretically” do the same thing in packs of 50 in order to save a lot of execution time.

https://developers.google.com/youtube/2.0/developers_guide_protocol_batch_processing

I certainly succeeded in this also, but I am having a problem, the data is coming back, but not completely, some info is missing (yt:statistics node), so I surfed the internet looking for a fix and I found this thread on Google:

https://groups.google.com/forum/?fromgroups=#!topic/youtube-api-gdata/YHopv4yJQzk

There is an answer of a developer of the Youtube API team, and they do not look very concerned on this.

Anyone tried this too? Is there any possible solution?

Thanks in advance and excuse my English.

  • 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-10T18:29:30+00:00Added an answer on June 10, 2026 at 6:29 pm

    I discovered that my problem was on the XML parsing and not on the API output. I was trying to convert the XML Output to JSON/Array to provide an easier data manipulation but I’ve got a hard time because of colons in node names and nesting, and any functions I’ve found over the internet weren’t capable of parsing XML data like this.

    I provide some code in case that it might be useful to someone:

        public static function generarXMLBatch($listaIdsYoutube)
        {
           $version = "2";
           $batchUrl = "https://gdata.youtube.com/feeds/api/users/batch?v=".$version;
           $entryUrl = "https://gdata.youtube.com/feeds/api/users/";
    
    
           $xmlDoc = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?>
                        <feed xmlns="http://www.w3.org/2005/Atom"
                                xmlns:media="http://search.yahoo.com/mrss/"
                                      xmlns:batch="http://schemas.google.com/gdata/batch"
                                      xmlns:yt="http://gdata.youtube.com/schemas/2007">
                                       <batch:operation type="query"/></feed>');
    
           foreach($listaIdsYoutube as $idYoutube) {
               $xmlDoc->addChild("entry")->addChild("id", $entryUrl.$idYoutube["perfilYoutube"]."?v=".$version);
           }
    
           //SimpleXML to String
           $xmlDoc = $xmlDoc->saveXML();
           //XML string to CURL
           $xmlDoc = My_Funciones::cURL_XML($batchUrl, $xmlDoc);
           //XML string CURL output to SimpleXML
           $xmlDoc = new SimpleXMLElement($xmlDoc);
    
           return $xmlDoc;
       }
    

    This function receive a Youtube ID list, generates the XML Batch query (you can query up to 50 videos/users… at the same time), and returns the output after the query in SimpleXML format so you can access via:

    $xmlDoc->entry->….

    Greetings

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

Sidebar

Related Questions

I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I have a text area in my form which accepts all possible characters from
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.