Skip to content

Commit e205151

Browse files
authored
Merge pull request #114847 from dksimpson/DKS-US1712683-bing-local-business-search
Refresh Bing Local Business Search REST API quickstarts
2 parents e662d12 + ef1c00e commit e205151

File tree

5 files changed

+42
-48
lines changed

5 files changed

+42
-48
lines changed

articles/cognitive-services/bing-local-business-search/quickstarts/local-quickstart.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,25 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-local-business
1010
ms.topic: quickstart
11-
ms.date: 03/24/2020
11+
ms.date: 05/12/2020
1212
ms.author: aahi
1313
---
1414

1515
# Quickstart: Send a query to the Bing Local Business Search API in C#
1616

17-
Use this quickstart to begin sending requests to the Bing Local Business Search API, which is an Azure Cognitive Service. While this simple application is written in C#, the API is a RESTful Web service compatible with any programming language capable of making HTTP requests and parsing JSON.
17+
Use this quickstart to learn how to send requests to the Bing Local Business Search API, which is an Azure Cognitive Service. Although this simple application is written in C#, the API is a RESTful Web service compatible with any programming language capable of making HTTP requests and parsing JSON.
1818

19-
This example application gets local response data from the API for the search query `hotel in Bellevue`.
19+
This example application gets local response data from the API for a search query.
2020

2121
## Prerequisites
2222

2323
* Any edition of [Visual Studio 2019](https://www.visualstudio.com/downloads/).
24-
* If you are using Linux/MacOS, this application can be run using [Mono](https://www.mono-project.com/).
25-
26-
You must have a [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with Bing Search APIs. The [free trial](https://azure.microsoft.com/try/cognitive-services/?api=bing-web-search-api) is sufficient for this quickstart. See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
24+
* If you're using Linux/MacOS, this application can be run using [Mono](https://www.mono-project.com/).
25+
* A [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with Bing Search APIs. For this quickstart, the [free trial](https://azure.microsoft.com/try/cognitive-services/?api=bing-web-search-api) is sufficient. Save the API key that's provided when you activate your free trial. For more information, see [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
2726

2827
## Create the request
2928

30-
The following code creates a `WebRequest`, sets the access key header, and adds a query string for "restaurant in Bellevue". It then sends the request and assigns the response to a string to contain the JSON text.
29+
The following code creates a `WebRequest`, sets the access key header, and adds a query string for *restaurant in Bellevue*. It then sends the request and assigns the response to a string to contain the JSON text.
3130

3231
```csharp
3332
// Replace the accessKey string value with your valid access key.
@@ -49,10 +48,10 @@ The following code creates a `WebRequest`, sets the access key header, and adds
4948

5049
## Run the complete application
5150

52-
The Bing Local Business Search API returns localized search results from the Bing search engine.
53-
1. Create a new Console solution in Visual Studio (the Community Edition is fine).
51+
The following code uses the Bing Local Business Search API to return localized search results from the Bing search engine. You can use this code by following these steps:
52+
1. Create a new console solution in Visual Studio (the Community Edition is sufficient).
5453
2. Replace Program.cs with the code provided below.
55-
3. Replace the accessKey value with an access key valid for your subscription.
54+
3. Replace the `accessKey` value with an access key valid for your subscription.
5655
4. Run the program.
5756

5857
```csharp
@@ -205,5 +204,5 @@ namespace localSearch
205204

206205
## Next steps
207206
- [Local Business Search Java quickstart](local-search-java-quickstart.md)
208-
- [Local Business Search Node quickstart](local-search-node-quickstart.md)
207+
- [Local Business Search Node.js quickstart](local-search-node-quickstart.md)
209208
- [Local Business Search Python quickstart](local-search-python-quickstart.md)

articles/cognitive-services/bing-local-business-search/quickstarts/local-search-java-quickstart.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,25 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-local-business
1010
ms.topic: quickstart
11-
ms.date: 11/29/2019
11+
ms.date: 05/12/2020
1212
ms.author: aahi
1313
---
1414

1515
# Quickstart: Send a query to the Bing Local Business Search API using Java
1616

17-
Use this quickstart to begin sending requests to the Bing Local Business Search API, which is an Azure Cognitive Service. While this simple application is written in Java, the API is a RESTful Web service compatible with any programming language capable of making HTTP requests and parsing JSON.
17+
Use this quickstart to learn how to send requests to the Bing Local Business Search API, which is an Azure Cognitive Service. Although this simple application is written in Java, the API is a RESTful Web service compatible with any programming language capable of making HTTP requests and parsing JSON.
1818

19-
This example application gets local response data from the API for the search query `hotel in Bellevue`.
19+
This example application gets local response data from the API for a search query.
2020

2121
## Prerequisites
2222

23-
* The [Java Development Kit(JDK)](https://www.oracle.com/technetwork/java/javase/downloads/index.html)
23+
* The [Java Development Kit (JDK)](https://www.oracle.com/technetwork/java/javase/downloads/index.html).
24+
* A [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with Bing Search APIs. For this quickstart, the [free trial](https://azure.microsoft.com/try/cognitive-services/?api=bing-web-search-api) is sufficient. Save the API key that's provided when you activate your free trial. For more information, see [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
2425

25-
You must have a [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with Bing Search APIs. The [free trial](https://azure.microsoft.com/try/cognitive-services/?api=bing-web-search-api) is sufficient for this quickstart. You will need the access key provided when you activate your free trial. See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
26-
27-
This example application gets local response data from the query for a *hotel in Bellevue*.
2826

2927
## Create the request
3028

31-
The following code creates a `WebRequest`, sets the access key header, and adds a query string for "hotel in Bellevue". It then sends the request and assigns the response to a string to contain the JSON text.
29+
The following code creates a `WebRequest`, sets the access key header, and adds a query string for *hotel in Bellevue*. It then sends the request and assigns the response to a string to contain the JSON text.
3230

3331
```java
3432
// construct URL of search request (endpoint + query string)
@@ -46,11 +44,11 @@ The following code creates a `WebRequest`, sets the access key header, and adds
4644
4745
## Run the complete application
4846
49-
The Bing Local Business Search API returns results from the Bing search engine.
47+
The following code uses the Bing Local Business Search API to return search results from the Bing search engine. Run this code by following these steps:
5048
1. Download or install the gson library.
5149
2. Create a new Java project in your favorite IDE or editor.
5250
3. Add the code provided below.
53-
4. Replace the subscriptionKey value with an access key valid for your subscription.
51+
4. Replace the `subscriptionKey` value with an access key valid for your subscription.
5452
5. Run the program.
5553
5654
```java
@@ -160,6 +158,6 @@ public class LocalSearchCls {
160158
```
161159

162160
## Next steps
163-
- [Local Business Search quickstart](local-quickstart.md)
164-
- [Local Business Search Node quickstart](local-search-node-quickstart.md)
161+
- [Local Business Search C# quickstart](local-quickstart.md)
162+
- [Local Business Search Node.js quickstart](local-search-node-quickstart.md)
165163
- [Local Business Search Python quickstart](local-search-python-quickstart.md)

articles/cognitive-services/bing-local-business-search/quickstarts/local-search-node-quickstart.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,33 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-local-business
1010
ms.topic: quickstart
11-
ms.date: 03/24/2020
11+
ms.date: 05/12/2020
1212
ms.author: aahi
1313
---
1414

1515
# Quickstart: Send a query to the Bing Local Business Search API using Node.js
1616

17-
Use this quickstart to begin sending requests to the Bing Local Business Search API, which is an Azure Cognitive Service. While this simple application is written in Node.js, the API is a RESTful Web service compatible with any programming language capable of making HTTP requests and parsing JSON.
17+
Use this quickstart to learn how to send requests to the Bing Local Business Search API, which is an Azure Cognitive Service. Although this simple application is written in Node.js, the API is a RESTful Web service compatible with any programming language capable of making HTTP requests and parsing JSON.
1818

19-
This example application gets local response data from the API for the search query `hotel in Bellevue`.
19+
This example application gets local response data from the API for a search query.
2020

2121
## Prerequisites
2222

2323
* The latest version of [Node.js](https://nodejs.org/en/download/).
24+
* The [JavaScript Request Library](https://github.com/request/request).
25+
* A [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with Bing Search APIs. For this quickstart, the [free trial](https://azure.microsoft.com/try/cognitive-services/?api=bing-web-search-api) is sufficient. Save the API key that's provided when you activate your free trial. For more information, see [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
2426

25-
* The [JavaScript Request Library](https://github.com/request/request)
26-
27-
You must have a [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with Bing APIs. The [free trial](https://azure.microsoft.com/try/cognitive-services/?api=bing-web-search-api) is sufficient for this quickstart. Use the access key provided by the free trial. See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
2827

2928
## Code scenario
3029

31-
The following code gets defines and sends the request. It is implemented in the following steps:
30+
The following code defines and sends the request, which is implemented in the following steps:
3231

3332
1. Declare variables to specify the endpoint by host and path.
3433
2. Specify the query, and add the query parameter.
3534
3. Create a handler function for the response.
36-
4. Define the Search function that creates the request and adds the Ocp-Apim-Subscription-Key header.
37-
5. Run the Search function.
35+
4. Define the Search function that creates the request and adds the `Ocp-Apim-Subscription-Key` header.
36+
5. Run the search function.
3837

39-
The complete code for this demo follows:
4038

4139
```javascript
4240
'use strict';
@@ -89,6 +87,6 @@ Search();
8987

9088
## Next steps
9189

92-
* [Local Business Search quickstart](local-quickstart.md)
90+
* [Local Business Search C# quickstart](local-quickstart.md)
9391
* [Local Business Search Java quickstart](local-search-java-quickstart.md)
9492
* [Local Business Search Python quickstart](local-search-python-quickstart.md)

articles/cognitive-services/bing-local-business-search/quickstarts/local-search-python-quickstart.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,31 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-local-business
1010
ms.topic: quickstart
11-
ms.date: 11/29/2019
11+
ms.date: 05/12/2020
1212
ms.author: aahi
1313
---
1414
# Quickstart: Send a query to the Bing Local Business Search API in Python
1515

16-
Use this quickstart to begin sending requests to the Bing Local Business Search API, which is an Azure Cognitive Service. While this simple application is written in Python, the API is a RESTful Web service compatible with any programming language capable of making HTTP requests and parsing JSON.
16+
Use this quickstart to learn how to send requests to the Bing Local Business Search API, which is an Azure Cognitive Service. Although this simple application is written in Python, the API is a RESTful Web service compatible with any programming language capable of making HTTP requests and parsing JSON.
1717

18-
This example application gets local response data from the API for the search query `hotel in Bellevue`.
18+
This example application gets local response data from the API for a search query.
1919

2020
## Prerequisites
2121

22-
* [Python](https://www.python.org/) 2.x or 3.x
23-
24-
You must have a [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with Bing APIs. The [free trial](https://azure.microsoft.com/try/cognitive-services/?api=bing-web-search-api) is sufficient for this quickstart. Use the access key provided by the free trial. See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
22+
* [Python](https://www.python.org/) 2.x or 3.x.
23+
* A [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with Bing Search APIs. For this quickstart, the [free trial](https://azure.microsoft.com/try/cognitive-services/?api=bing-web-search-api) is sufficient. Save the API key that's provided when you activate your free trial. For more information, see [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
2524

2625
## Run the complete application
2726

28-
The following code gets localized results. It is implemented in the following steps:
27+
The following example gets localized results, which are implemented in the following steps:
2928
1. Declare variables to specify the endpoint by host and path.
3029
2. Specify the query parameter.
31-
3. Define the Search function that creates the request and adds the Ocp-Apim-Subscription-Key header.
32-
4. Set the Ocp-Apim-Subscription-Key header.
30+
3. Define the search function that creates the request and adds the `Ocp-Apim-Subscription-Key` header.
31+
4. Set the `Ocp-Apim-Subscription-Key` header.
3332
5. Make the connection and send the request.
3433
6. Print the JSON results.
3534

36-
The complete code for this demo follows:
35+
The complete code for this demo is as follows:
3736

3837
```python
3938
import http.client, urllib.parse
@@ -62,6 +61,6 @@ print (json.dumps(json.loads(result), indent=4))
6261
```
6362

6463
## Next steps
65-
- [Local Business Search Java Quickstart](local-search-java-quickstart.md)
66-
- [Local Business Search C# Quickstart](local-quickstart.md)
67-
- [Local Business Search Node Quickstart](local-search-node-quickstart.md)
64+
- [Local Business Search Java quickstart](local-search-java-quickstart.md)
65+
- [Local Business Search C# quickstart](local-quickstart.md)
66+
- [Local Business Search Node.js quickstart](local-search-node-quickstart.md)

articles/cognitive-services/bing-local-business-search/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
href: quickstarts/local-quickstart.md
2020
- name: Using Java
2121
href: quickstarts/local-search-java-quickstart.md
22-
- name: Using Node
22+
- name: Using Node.js
2323
href: quickstarts/local-search-node-quickstart.md
2424
- name: Using Python
2525
href: quickstarts/local-search-python-quickstart.md

0 commit comments

Comments
 (0)