SearchRequest.CultureInfo Property (Search)

Language and country/region information for the SearchRequest.

public string CultureInfo { get; set; }
Remarks

CultureInfo has no service-provided default value and must be specified on each SearchRequest. The following CultureInfo values are supported:

 

Culture Name Language-Country/Region

ar-XA

Arabic – Arabia

bg-BG

Bulgarian – Bulgaria

cs-CZ

Czech – Czech Republic

da-DK

Danish – Denmark

de-AT

German – Austria

de-CH

German – Switzerland

de-DE

German – Germany

el-GR

Greek – Greece

en-AU

English – Australia

en-CA

English – Canada

en-GB

English – United Kingdom

en-ID

English – Indonesia

en-IE

English – Ireland

en-IN

English – India

en-MY

English – Malaysia

en-NZ

English – New Zealand

en-PH

English – Philippines

en-SG

English – Singapore

en-US

English – United States

en-XA

English – Arabia

en-ZA

English – South Africa

es-AR

Spanish – Argentina

es-CL

Spanish – Chile

es-ES

Spanish – Spain

es-MX

Spanish – Mexico

es-US

Spanish – United States

es-XL

Spanish – Latin America

et-EE

Estonian – Estonia

fi-FI

Finnish – Finland

fr-BE

French – Belgium

fr-CA

French – Canada

fr-CH

French – Switzerland

fr-FR

French – France

he-IL

Hebrew – Israel

hr-HR

Croatian – Croatia

hu-HU

Hungarian – Hungary

it-IT

Italian – Italy

ja-JP

Japanese – Japan

ko-KR

Korean – Korea

lt-LT

Lithuanian – Lithuania

lv-LV

Latvian – Latvia

nb-NO

Norwegian – Norway

nl-BE

Dutch – Belgium

nl-NL

Dutch – Netherlands

pl-PL

Polish – Poland

pt-BR

Portuguese – Brazil

pt-PT

Portuguese – Portugal

ro-RO

Romanian – Romania

ru-RU

Russian – Russia

sk-SK

Slovak – Slovak Republic

sl-SL

Slovenian – Slovenia

sv-SE

Swedish – Sweden

th-TH

Thai – Thailand

tr-TR

Turkish – Turkey

uk-UA

Ukrainian – Ukraine

zh-CN

Chinese – China

zh-HK

Chinese – Hong Kong SAR

zh-TW

Chinese – Taiwan

Example

This example requests All fields for the WebSourceType, in order to filter results, using the following values:

  • Location: Mazatlán, Sinaloa, Mexico.

  • CultureInfo setting: es-MX (Spanish, as spoken in Mexico).

  • SearchFlags.MarkQueryWords setting: displays tokens around the search term.

  • Query: corona.

  • SafeSearchOptions.Strict setting: filters results (strict).

The output displays the title, description, and URL in a Console Window. The setting code for the AppID property is featured in bold, below.

try
{
    MSNSearchService s = new MSNSearchService();
    SearchRequest searchRequest = new SearchRequest();
    int arraySize = 1;
    SourceRequest[] sr = new SourceRequest[arraySize];

    sr[0] = new SourceRequest();
    sr[0].Source = SourceType.Web;
    sr[0].ResultFields = ResultFieldMask.All;

    // Enter the Application ID, in double quotation marks, supplied by the 
    // Developer Provisioning System as the value of the AppID on the SearchRequest.
    searchRequest.AppID = "YOUR_APP_ID_GOES_HERE";
    searchRequest.CultureInfo = "es-MX";
    searchRequest.Flags = SearchFlags.MarkQueryWords;
    searchRequest.Location = new Location();
        double latitude = 23.6683;
        double longitude = -105.7238;
        double radius = 25.0;
        searchRequest.Location.Latitude = latitude;
        searchRequest.Location.Longitude = longitude;
        searchRequest.Location.Radius = radius;
    searchRequest.Query = "corona";
    searchRequest.Requests = sr;
    searchRequest.SafeSearch = SafeSearchOptions.Strict;

    SearchResponse searchResponse;

    searchResponse = s.Search(searchRequest);
    foreach (SourceResponse sourceResponse in searchResponse.Responses)
    {
        Result[] sourceResults = sourceResponse.Results;
        if (searchResponse.Responses[0].Total > 0)
        {
            Console.WriteLine(sourceResponse.Source.ToString() + " - Total Results: " + sourceResponse.Total.ToString());
            Console.WriteLine();
        }
        foreach (Result sourceResult in sourceResults)
        {
            if ((sourceResult.Title != null) && (sourceResult.Title != String.Empty))
                Console.WriteLine("Title: " + sourceResult.Title);
            if ((sourceResult.Description != null) && (sourceResult.Description != String.Empty))
                Console.WriteLine("Description: " + sourceResult.Description);
            if ((sourceResult.Url != null) && (sourceResult.Url != String.Empty))
                Console.WriteLine("Url: " + sourceResult.Url);
            Console.WriteLine("*****************************************************");
        }
            Console.WriteLine("Press any key to exit.");
        Console.ReadLine();
    }
}
catch (System.Web.Services.Protocols.SoapException fault)
{
    Console.WriteLine(fault.Detail.InnerText.ToString());
    Console.WriteLine("Press any key to exit.");
    Console.ReadLine();
}
catch (System.Net.WebException webx)
{
    Console.WriteLine(webx.ToString());
}

The following sample output shows results of this query. Note that, if you run the same query, your output is likely to be different due to the fact that you ran your query at a later time.

Web - Total Results: 5097625

Title: ?corona?.com.mx

Description: Este sitio de Internet se encuentra dirigido hacia el uso personal, en países y otros territorios en los cuales el consumo de bebidas alcohólicas es permitido ...

Url: http://www.corona.com.mx/

*****************************************************

Title: ?corona?.com.mx

Description: Lo sentimos, para ingresar a ?corona?.com.mx debe de ser mayor de edad.

Url: http://www.corona.com.mx/cancelar.html

*****************************************************

Title: Grupo Modelo

Description: Productores de las cervezas ?Corona?, Modelo, Victoria, Montejo, Pacífico, Estrella y León. (Símbolo: GMODELO).

Url: http://www.gmodelo.com.mx/

*****************************************************

Title: Desafio ?Corona? 2006

Description: La temporada 2006 del Desafío ?Corona? llegó a su fin con la Fiesta de Premiacón para honar a los campeones de la Stock Car y la Serie T4, donde además se realizó el importante anuncio de la ...

Url: http://www.desafiocorona.com/

*****************************************************

Title: Hacienda ?Corona? de Guevavi Bed & Breakfast

Description: Hacienda ?Corona? de Guevavi Bed & Breakfast is a small, romantic boutique Inn, located in the historic border town of Nogales, Arizona.

Url: http://www.haciendacorona.com/

*****************************************************

Title: Fundación ?Corona?

Description: Respaldada por la empresa ?Corona?, busca disminuir los niveles deinequidad y falta de oportunidades de la población más pobre del país.

Url: http://www.fundacioncorona.org.co/

*****************************************************

Title: Claudia ?Corona?

Description: El explorador no admite los marcos flotantes o no está configurado actualmente para mostrarlos, recomendamos actualice su versión. ...

Url: http://www.claudiacorona.com/Default.htm

*****************************************************

Title: HOTEL ?CORONA?

Description: HOTEL ?CORONA? ENSENADA MEXICO THE BEST HOTEL IN TOWN!

Url: http://www.hotelcorona.com.mx/

*****************************************************

Title: maggit » The Killers en México y ?Corona? Music Fest

Description: Pues sí, The Killers estará en nuestro país el próximo 13 de Diciembre en el Palacio de los Deportes, no era muy fan de esta banda, el Hot fuss megustó pero nada fuera de lo normal, pero desde ...

Url: http://maggit.com.mx/blog/?p=139

*****************************************************

Title: Salón ?Corona? - Todos los caminos llevan... al Salón ?Corona?

Description: Del Norte: Insurgentes Norte , a la derecha en la salida a la Av. Guerrero (Eje 1 poniente), en el cruce con la Av. Reforma a la izquierda , Av. Ju

árez a la derecha (pasa por la Alameda Central y ...

Url: http://www.saloncorona.com.mx/sllegar.html

*****************************************************

Press any key to exit.

Page view tracker