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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:13:24+00:00 2026-05-26T02:13:24+00:00

I have a URL: https://gdata.youtube.com/feeds/api/users/charlieissocoollike/uploads?alt=jsonc&v=2 which supplies JSON information on latest youtube uploads from

  • 0

I have a URL: https://gdata.youtube.com/feeds/api/users/charlieissocoollike/uploads?alt=jsonc&v=2 which supplies JSON information on latest youtube uploads from a user.

I have written some code to parse this JSON data but I don’t understand how JSON works and how to parse it in Java.

public void getVideoData() throws ClientProtocolException, JSONException, IOException {

    JSONObject object = (JSONObject) new JSONTokener(getVideoJSON().toString()).nextValue();
    //String query = object.getString("data");
    JSONArray locations = object.getJSONArray("data");
    output.setText(locations.getString(1));

}

public JSONObject getVideoJSON () throws ClientProtocolException, IOException, JSONException {
    final String URL = "https://gdata.youtube.com/feeds/api/users/charlieissocoollike/uploads?alt=jsonc&v=2";

    StringBuilder url = new StringBuilder(URL);
    HttpGet get = new HttpGet(url.toString());      
    HttpResponse r = client.execute(get);       
    int status = r.getStatusLine().getStatusCode();
        HttpEntity e = r.getEntity();           
        String data = EntityUtils.toString(e);          
        JSONArray VideoData = new JSONArray(data);      
        JSONObject video = VideoData.getJSONObject(0);  

        return video;           
}

How should I pull the video id, title and description from the JSON Data of each video object?

  • 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-05-26T02:13:25+00:00Added an answer on May 26, 2026 at 2:13 am

    You’re almost there. What you need is:

    JSONObject json = new JSONObject(data);
    JSONObject dataObject = json.getJSONObject("data"); // this is the "data": { } part
    JSONArray items = dataObject.getJSONArray("items"); // this is the "items: [ ] part
    

    Then you can traverse over each video:

    for (int i = 0; i < items.length(); i++) {
        JSONObject videoObject = items.getJSONObject(i); 
        String title = videoObject.getString("title");
        String videoId = videoObject.getString("id");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var url = 'http://gdata.youtube.com/feeds/api/playlists/18508B7EDC293770?v=2&alt=json'; $.ajax({ url: url, cache: false, data: , type: GET, dataType:
<script type= text/javascript> var url = http://gdata.youtube.com/feeds/api/videos/VA770wpLX-Q?v=2&amp;alt=json-in-script&amp;callback=; var title; var description; var viewcount; var
I am trying to parse a youtube playlist field. The URL is: http://gdata.youtube.com/feeds/api/playlists/664AA68C6E6BA19B?v=2 I
I need to fetch the playlist for specific username. [NSString stringWithFormat:@http://gdata.youtube.com/feeds/api/users/%@/playlists?alt=json&v=2&orderby=published&client=ytapi-youtube-profile,strUserName]; I use the
I have a URL which can be any of the following formats: http://example.com https://example.com
Im trying to get the callback from this: $.getScript( 'http://gdata.youtube.com/feeds/api/videos/<?php echo $m; ?>?v=2&alt=json-in-script', function(data)
I have a string like this a web url https://stackoverflow.com/questions/ 3260091 /databases-and-deep-copy how can
We have a web applet that loads under the URL https://secure-ausomxeja.crmondemand.com/OnDemand/ ... from where
I need to make a cURL request to a https URL, but I have
I have a hard coded URL like so: https://bupacouk.bwa.local.internal.bupa.co.uk/cash-plan-quote/quoteAction.do?getBenefitLevelDetails=getBenefitLevelDetails&productPolicyId=7841#a1 When Javascript is enabled 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.