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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:21:16+00:00 2026-05-15T03:21:16+00:00

How can I get the data from this xml site ( http://xboxapi.duncanmackenzie.net/gamertag.ashx?GamerTag=Festive+Turkey ) and

  • 0

How can I get the data from this xml site ( http://xboxapi.duncanmackenzie.net/gamertag.ashx?GamerTag=Festive+Turkey ) and specify the data and use it as a string?

  • 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-15T03:21:17+00:00Added an answer on May 15, 2026 at 3:21 am

    If you want to get the XML into a readable data structure directly, you can load it via the URI directly into an XDocument object.

    string uri = "http://xboxapi.duncanmackenzie.net/gamertag.ashx?GamerTag=Festive+Turkey";
    XDocument document = XDocument.Load(uri);
    

    You can then easily extract the information via Linq-to-XML into either a concrete or anonymous type. (Check the System.Linq and System.Xml.Linq namespaces.)

    Other methods of dealing with the XML include serialization, XmlDocuments and XPath, etc.

    Here is a sample of something you could do with XML and Linq.

    using System;
    using System.Linq;
    using System.Xml.Linq;
    
    class XboxStats
    {
        static void Main()
        {
            string uri = "http://xboxapi.duncanmackenzie.net/gamertag.ashx?GamerTag=Festive+Turkey";
            XDocument document = XDocument.Load(uri);
    
            var xboxInfo = document.Element("XboxInfo");
    
            var data = new
            {
                AccountStatus = (string)xboxInfo.Element("AccountStatus"),
                PresenceInfo = new
                {
                    Valid = (bool)xboxInfo.Element("PresenceInfo").Element("Valid"),
                    Info = (string)xboxInfo.Element("PresenceInfo").Element("Info"),
                    Info2 = (string)xboxInfo.Element("PresenceInfo").Element("Info2"),
                    LastSeen = (DateTime)xboxInfo.Element("PresenceInfo").Element("LastSeen"),
                    Online = (bool)xboxInfo.Element("PresenceInfo").Element("Online"),
                    StatusText = (string)xboxInfo.Element("PresenceInfo").Element("StatusText"),
                    Title = (string)xboxInfo.Element("PresenceInfo").Element("Title")
                },
                State = (string)xboxInfo.Element("State"),
                Gamertag = (string)xboxInfo.Element("Gamertag"),
                ProfileUrl = (string)xboxInfo.Element("ProfileUrl"),
                TileUrl = (string)xboxInfo.Element("TileUrl"),
                Country = (string)xboxInfo.Element("Country"),
                Reputation = (decimal)xboxInfo.Element("Reputation"),
                Bio = (string)xboxInfo.Element("Bio"),
                Location = (string)xboxInfo.Element("Location"),
                ReputationImageUrl = (string)xboxInfo.Element("ReputationImageUrl"),
                GamerScore = (int)xboxInfo.Element("GamerScore"),
                Zone = (string)xboxInfo.Element("Zone"),
                RecentGames = new
                {
                    XboxUserGameInfos = from gameInfo in xboxInfo.Element("RecentGames").Elements("XboxUserGameInfo")
                                        select new
                                        {
                                            Game = new
                                            {
                                                Name = (string)gameInfo.Element("Game").Element("Name"),
                                                TotalAchievements = (int)gameInfo.Element("Game").Element("TotalAchievements"),
                                                TotalGamerScore = (int)gameInfo.Element("Game").Element("TotalGamerScore"),
                                                Image32Url = (string)gameInfo.Element("Game").Element("Image32Url"),
                                                Image64Url = (string)gameInfo.Element("Game").Element("Image64Url")
                                            },
                                            LastPlayed = (DateTime)gameInfo.Element("LastPlayed"),
                                            Achievements = (int)gameInfo.Element("Achievements"),
                                            GamerScore = (int)gameInfo.Element("GamerScore"),
                                            DetailsUrl = (string)gameInfo.Element("DetailsUrl")
                                        }
    
                }
            };
    
            Console.WriteLine(data.AccountStatus);
    
            foreach (var gameInfo in data.RecentGames.XboxUserGameInfos)
            {
                Console.WriteLine(gameInfo.Game.Name);
            }
    
            Console.Read();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I gather the data into c# from this xml? I get the
Can I read a XML file from remote server such as http://dealer.somedomain.com/data/inventory.xml I need
How can we get data from the server in an asynchronous way in Flash?
Using LINQ can I get the data from the table into the format shown
How can I get ALL the data from a table of my DB (mySQL)
How can I get the array data from a JSON sent back by my
Both StreamReader and BinaryReader can be used to get data from binary file (
I found that PageProxy can be used to get data from page, but I
How can I get a DataSet with all the data from a SQL Express
How can I get at the Labels data from within my Task model? class

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.