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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:03:17+00:00 2026-05-18T07:03:17+00:00

Using the following snippet of code, I can get 4 results from the google

  • 0

Using the following snippet of code, I can get 4 results from the google Web Search API. I know I’m using a deprecated API, but I’m only testing something here and will use the new Custom Search API when I’m more familiar with it. For now, though, I was wondering how I can parse the returned result for the “unescapedUrl” that is in the result? Basically, I want to grab all four of the “unescapedUrl” values in the returned JSON.
Here’s my code:

var searchTerm = "pizza boxes";
        using (var web = new WebClient())
        {
            web.Headers.Add("Referrer", "http://localhost:49360/");
            var result = web.DownloadString(String.Format(
                   "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q={0}&rsz=4",
                   searchTerm));
            Console.WriteLine(result);
        }

I don’t want to use JSON.Net with this (for now) unless I absolutely have to. Any ideas?

Thanks!

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

    You’d need to create a type, but have you thought about using JavaScriptSerializer from System.Web.Extensions.dll?

    I can’t say I know the Google API well, but if it’s a simple JSON property bag that’s returned, you could get away with something as simple as this:

    System.Web.Script.Serialization.JavaScriptSerializer ser = new System.Web.Script.Serialization.JavaScriptSerializer();
    
    System.Collections.Generic.Dictionary<string, object> dict = ser.DeserializeObject(@"{""key"":""value""}") as System.Collections.Generic.Dictionary<string, object>;
    
    Console.WriteLine(dict["key"].ToString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From the book Groovy and Grails recipes I'm using the following code snippet: String
I'm pulling data from Dynamics AX 2009 from c# using the following code snippet.
I'm using the following code-snippet extensively in my model templates. <div class=control-group> @Html.LabelFor(model =>
I have the following snippet of code (I'm using jQuery 1.4.2): $.post('/Ads/GetAdStatsRow/', { 'ad_id':
I have the following code snippet: using (SPSite site = new SPSite(this.ListAddress)) { using
The following is a Python code snippet using the ast and symtable packages. I
I am using the following code snippet to copy/backup database Public Sub backupData() Try
The following snippet is from a little app I wrote using the Qt framework.
Im using the following code snippet .append( $('<td>').append( $('<a>').attr({ href: '#', class: 'assDelete', dataassetid:
I want to get data from an API using Python. The API documentation give

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.