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

  • Home
  • SEARCH
  • 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 9114255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:09:33+00:00 2026-06-17T04:09:33+00:00

I want to get some elements from json response from youtube api: I get

  • 0

I want to get some elements from json response from youtube api:
I get this response in my script:

{
  "version": "1.0",
  "encoding": "UTF-8",
  "feed": {
    "xmlns": "http://www.w3.org/2005/Atom",
    "xmlns$media": "http://search.yahoo.com/mrss/",
    "xmlns$openSearch": "http://a9.com/-/spec/opensearchrss/1.0/",
    "xmlns$gd": "http://schemas.google.com/g/2005",
    "xmlns$yt": "http://gdata.youtube.com/schemas/2007",
    "id": {
      "$t": "http://gdata.youtube.com/feeds/api/videos"
    },
    "updated": {
      "$t": "2013-01-13T15:48:18.863Z"
    },
    "category": [
      {
        "scheme": "http://schemas.google.com/g/2005#kind",
        "term": "http://gdata.youtube.com/schemas/2007#video"
      }
    ],
    "title": {
      "$t": "Videos matching: humor",
      "type": "text"
    },
    "logo": {
      "$t": "http://www.youtube.com/img/pic_youtubelogo_123x63.gif"
    },
    "link": [
      {
        "rel": "alternate",
        "type": "text/html",
        "href": "http://www.youtube.com"
      },
      {
        "rel": "http://schemas.google.com/g/2005#feed",
        "type": "application/atom+xml",
        "href": "http://gdata.youtube.com/feeds/api/videos"
      },
      {
        "rel": "http://schemas.google.com/g/2005#batch",
        "type": "application/atom+xml",
        "href": "http://gdata.youtube.com/feeds/api/videos/batch"
      },
      {
        "rel": "self",
        "type": "application/atom+xml",
        "href": "http://gdata.youtube.com/feeds/api/videos?alt=json&q=humor&start-index=1&max-results=1&lr=es&orderby=published"
      },
      {
        "rel": "next",
        "type": "application/atom+xml",
        "href": "http://gdata.youtube.com/feeds/api/videos?alt=json&q=humor&start-index=2&max-results=1&lr=es&orderby=published"
      }
    ],
    "author": [
      {
        "name": {
          "$t": "YouTube"
        },
        "uri": {
          "$t": "http://www.youtube.com/"
        }
      }
    ],
    "generator": {
      "$t": "YouTube data API",
      "version": "2.1",
      "uri": "http://gdata.youtube.com"
    },
    "openSearch$totalResults": {
      "$t": 10595
    },
    "openSearch$startIndex": {
      "$t": 1
    },
    "openSearch$itemsPerPage": {
      "$t": 1
    },
    "entry": [
      {
        "id": {
          "$t": "http://gdata.youtube.com/feeds/api/videos/HAUdFeouzgM"
        },
        "published": {
          "$t": "2013-01-13T15:43:26.000Z"
        },
        "updated": {
          "$t": "2013-01-13T15:43:26.000Z"
        },
        "category": [
          {
            "scheme": "http://schemas.google.com/g/2005#kind",
            "term": "http://gdata.youtube.com/schemas/2007#video"
          },
          {
            "scheme": "http://gdata.youtube.com/schemas/2007/categories.cat",
            "term": "Film",
            "label": "Cine y animación"
          }
        ],
        "title": {
          "$t": "Chica Troll en dibujo: TiparracoSA (IrukoArt)",
          "type": "text"
        },
        "content": {
          "$t": "Canal del artista creador: www.youtube.com Si quieres ver camaras ocultas dale aqui: www.youtube.com Si quieres ver a la chica troll VS pervertidos aqui: www.youtube.com Canal principal --- (Bromas con camara oculta y humor) www.youtube.com Sigueme en Twitter: twitter.com Sigueme en Facebook: www.facebook.com",
          "type": "text"
        },
        "link": [
          {
            "rel": "alternate",
            "type": "text/html",
            "href": "http://www.youtube.com/watch?v=HAUdFeouzgM&feature=youtube_gdata"
          },
          {
            "rel": "http://gdata.youtube.com/schemas/2007#video.responses",
            "type": "application/atom+xml",
            "href": "http://gdata.youtube.com/feeds/api/videos/HAUdFeouzgM/responses"
          },
          {
            "rel": "http://gdata.youtube.com/schemas/2007#video.related",
            "type": "application/atom+xml",
            "href": "http://gdata.youtube.com/feeds/api/videos/HAUdFeouzgM/related"
          },
          {
            "rel": "http://gdata.youtube.com/schemas/2007#mobile",
            "type": "text/html",
            "href": "http://m.youtube.com/details?v=HAUdFeouzgM"
          },
          {
            "rel": "self",
            "type": "application/atom+xml",
            "href": "http://gdata.youtube.com/feeds/api/videos/HAUdFeouzgM"
          }
        ],
        "author": [
          {
            "name": {
              "$t": "TiparracoTV"
            },
            "uri": {
              "$t": "http://gdata.youtube.com/feeds/api/users/TiparracoTV"
            }
          }
        ],
        "gd$comments": {
          "gd$feedLink": {
            "rel": "http://gdata.youtube.com/schemas/2007#comments",
            "href": "http://gdata.youtube.com/feeds/api/videos/HAUdFeouzgM/comments",
            "countHint": 0
          }
        },
        "media$group": {
          "media$category": [
            {
              "$t": "Film",
              "label": "Cine y animación",
              "scheme": "http://gdata.youtube.com/schemas/2007/categories.cat"
            }
          ],
          "media$content": [
            {
              "url": "http://www.youtube.com/v/HAUdFeouzgM?version=3&f=videos&app=youtube_gdata",
              "type": "application/x-shockwave-flash",
              "medium": "video",
              "isDefault": "true",
              "expression": "full",
              "duration": 324,
              "yt$format": 5
            },
            {
              "url": "rtsp://v1.cache2.c.youtube.com/CiILENy73wIaGQkDzi7qFR0FHBMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp",
              "type": "video/3gpp",
              "medium": "video",
              "expression": "full",
              "duration": 324,
              "yt$format": 1
            },
            {
              "url": "rtsp://v1.cache2.c.youtube.com/CiILENy73wIaGQkDzi7qFR0FHBMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp",
              "type": "video/3gpp",
              "medium": "video",
              "expression": "full",
              "duration": 324,
              "yt$format": 6
            }
          ],
          "media$description": {
            "$t": "Canal del artista creador: www.youtube.com Si quieres ver camaras ocultas dale aqui: www.youtube.com Si quieres ver a la chica troll VS pervertidos aqui: www.youtube.com Canal principal --- (Bromas con camara oculta y humor) www.youtube.com Sigueme en Twitter: twitter.com Sigueme en Facebook: www.facebook.com",
            "type": "plain"
          },
          "media$keywords": {

          },
          "media$player": [
            {
              "url": "http://www.youtube.com/watch?v=HAUdFeouzgM&feature=youtube_gdata_player"
            }
          ],
          "media$thumbnail": [
            {
              "url": "http://i.ytimg.com/vi/HAUdFeouzgM/0.jpg",
              "height": 360,
              "width": 480,
              "time": "00:02:42"
            },
            {
              "url": "http://i.ytimg.com/vi/HAUdFeouzgM/1.jpg",
              "height": 90,
              "width": 120,
              "time": "00:01:21"
            },
            {
              "url": "http://i.ytimg.com/vi/HAUdFeouzgM/2.jpg",
              "height": 90,
              "width": 120,
              "time": "00:02:42"
            },
            {
              "url": "http://i.ytimg.com/vi/HAUdFeouzgM/3.jpg",
              "height": 90,
              "width": 120,
              "time": "00:04:03"
            }
          ],
          "media$title": {
            "$t": "Chica Troll en dibujo: TiparracoSA (IrukoArt)",
            "type": "plain"
          },
          "yt$duration": {
            "seconds": "324"
          }
        },
        "yt$statistics": {
          "favoriteCount": "0",
          "viewCount": "1"
        }
      }
    ]
  }
}

I want to access some elements like title, tags, and link to use in my script. I eval json and i try to access to elements, but are inside arrays and another json objects i think and can’t get the script work:

   var datos=data.responseText;

    var respuesta = eval("(" + data.responseText + ")");

    alert(respuesta.entry.title);

This code don’t work, how i can access to the elements?

  • 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-17T04:09:34+00:00Added an answer on June 17, 2026 at 4:09 am

    Try alert(respuesta.entry[0].title); instead. entry is an array.

    EDIT Also as we noted in the comments entry is yet one more level deeper in the json. The correct expression is actually: alert(respuesta.feed.entry[0].title);. I suggest you use Online JSON Beautifier to beutify your json and make it easier to understand.

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

Sidebar

Related Questions

I want to simply exclude some array elements from another array and get the
I want to get some useful information from NSError . If I print out
I want to get some basic info of all contacts(I use api lvl 8).
I want to get some images from a movie and make a gif. What
I want to get some text from a PHP page into an Android application.
I want to get some images from a flash webpage and I got the
i am developing and application in which i want to get some feeds from
I am using http://lite.facebook.com And i want to get some data from my account.
I have code, which get json file from server and then render some if
I am getting some data from a database and am encoding it to json:

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.