Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This topic contains the following details of a RelatedSearch SourceType query sent to the SOAP interface:
Request Example
Response Example
Code Sample
For an example of code that might generate the request in this topic, see SOAP Code Samples (RelatedSearch SourceType).
Request Example
This section contains an example of an HTTP query string that the aforementioned code might generate.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="https://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<SearchRequest xmlns="https://schemas.microsoft.com/LiveSearch/2008/03/Search">
<parameters>
<Market>en-us</Market>
<Query>free</Query>
<AppId>Insert your AppId</AppId>
<Options>
<SearchOption>EnableHighlighting</SearchOption>
</Options>
<Sources>
<SourceType>RelatedSearch</SourceType>
</Sources>
</parameters>
</SearchRequest>
</soap:Body>
</soap:Envelope>
Response Example
This section contains an example of a response that Bing might return when sent the query string in the previous section:
<?xml version="1.0" encoding="utf-8"?>
<!--pageview_candidate-->
<soapenv:Envelope xmlns:soapenv="https://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<SearchResponse xmlns="https://schemas.microsoft.com/LiveSearch/2008/03/Search">
<parameters>
<Version>2.0</Version>
<Query>
<SearchTerms>free</SearchTerms>
</Query>
<RelatedSearch>
<Results>
<RelatedSearchResult>
<Title>Free Stuff</Title>
<Url>https://bing.com/results.aspx?q=Free+Stuff</Url>
</RelatedSearchResult>
<RelatedSearchResult>
<Title>Free Games</Title>
<Url>https://bing.com/results.aspx?q=Free+Games</Url>
</RelatedSearchResult>
<RelatedSearchResult>
<Title>Free Music Downloads</Title>
<Url>https://bing.com/results.aspx?q=Free+Music+Downloads</Url>
</RelatedSearchResult>
<RelatedSearchResult>
<Title>Freebox</Title>
<Url>https://bing.com/results.aspx?q=Freebox</Url>
</RelatedSearchResult>
<RelatedSearchResult>
<Title>Free Internet</Title>
<Url>https://bing.com/results.aspx?q=Free+Internet</Url>
</RelatedSearchResult>
<RelatedSearchResult>
<Title>Free Clip Art</Title>
<Url>https://bing.com/results.aspx?q=Free+Clip+Art</Url>
</RelatedSearchResult>
<RelatedSearchResult>
<Title>Free Screensavers</Title>
<Url>https://bing.com/results.aspx?q=Free+Screensavers</Url>
</RelatedSearchResult>
<RelatedSearchResult>
<Title>Free Ringtones</Title>
<Url>https://bing.com/results.aspx?q=Free+Ringtones</Url>
</RelatedSearchResult>
</Results>
</RelatedSearch>
</parameters>
</SearchResponse>
</soapenv:Body>
</soapenv:Envelope>