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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:01:22+00:00 2026-06-18T07:01:22+00:00

I am trying to parse a JSON object in C# from Twitter using JObject

  • 0

I am trying to parse a JSON object in C# from Twitter using JObject I cannot seem to figure out where the starting point is for the results that I need. For example:

I need to get the following:

  • Avatar URL
  • Twitter name
  • Message

The JSON string looks like the following:

{“completed_in”:0.01,”max_id”:297026363595042816,”max_id_str”:”297026363595042816″,”page”:1,”query”:”UOL01″,”refresh_url”:”?since_id=297026363595042816&q=O1″,”results”:[{“created_at”:”Thu, 31 Jan 2013 16:59:38 +0000″,”from_user”:”CarrieLouiseH”,”from_user_id”:252240491,”from_user_id_str”:”252240491″,”from_user_name”:”Carrie Haworth”,”geo”:null,”id”:297026363595042816,”id_str”:”297026363595042816″,”iso_language_code”:”nl”,”metadata”:{“result_type”:”recent”},”profile_image_url”:”http://a0.twimg.com/profile_images/1721499350/5680_216695890261_521090261_7945528_588811_n_normal.jpg&#8221;,”profile_image_url_https”:”https://si0.twimg.com/profile_images/1721499350/5680_216695890261_521090261_7945528_588811_n_normal.jpg&#8221;,”source”:”<a href="http://twitter.com/">web</a>&#8221;,”text”:”Test #01″,”to_user”:null,”to_user_id”:0,”to_user_id_str”:”0″,”to_user_name”:null}],”results_per_page”:15,”since_id”:0,”since_id_str”:”0″}

My assumption was that if I started at “results” then I could have access to “from_user” etc.. Here is my code (so far):

void DownloadStringCompleted(object senders, DownloadStringCompletedEventArgs e)
    {
        try
        {
            List<TwitterItem> contentList = new List<TwitterItem>();

            JObject ja = JObject.Parse(e.Result);
            int count = 0;

            JToken jUser = ja["results"];

            var name2 = (string)jUser["from_user_name"];
        }catch(Exception e){
         MessageBox.Show("There was an error");
        }
    }

But this just seems to catch the Exception. Anyone have any ideas to where I am going wrong?

  • 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-18T07:01:23+00:00Added an answer on June 18, 2026 at 7:01 am

    The JSON you have is incorrect – the " of the element results[0][“source”] should be escaped:

    ...,"source":"<a href=\"http://twitter.com/\">web</a>","...
    

    Also, ja["results"] is an array. You cannot use the string indexer to get its element. You first need to get the element on the desired index, then you can access its from_user_name property:

    JObject ja = JObject.Parse(e.Result);
    int count = 0;
    JToken jUser = ja["results"][0];
    var name2 = (string)jUser["from_user_name"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to Parse Json search results from twitter and I am using JArray.
I am trying to parse the JSON results from an AJAX call, but do
I'm trying to parse some JSON coming from an AJAX request using jQuery. Basically,
I'm trying to parse JSON string using Boost Spirit store JSON object into recursive
I am trying to make an app that parses data from Twitter using JSON
I am trying to parse a JSON script from my server which contains a
I was trying to parse a JSON string from USGS . However I get
I am trying to parse the json values from the following stream: {id: tag:search.xxxxx.com,2005:xxxxxxxxxxx}
I;m trying to parse a json string which I receive from web server as
I'm trying to load and parse json data from an external source into a

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.