# Bing Search API

Here is the list of default parameters you can use with this API:

|                              Parameter                             |                                                                                                              Description                                                                                                              |
| :----------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| <p>api\_key<br></p><p><mark style="color:red;">required</mark></p> |                                                                                                         This is your API key.                                                                                                         |
|   <p>query<br></p><p><mark style="color:red;">required</mark></p>  |                                                                                       <p>Type: <code>String</code> <br><br>Bing Search Query</p>                                                                                      |
|                              location                              |        <p>Type: <code>String</code></p><p><br>Default: <code>"us"</code> <br>Name of the country. The name should be in <a href="https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes">ISO 3166 Alpha-2</a> format.</p>       |
|                                 lat                                |                                                                                <p>Type: <code>String</code></p><p><br>The latitude of the location.</p>                                                                               |
|                                long                                |                                                                               <p>Type: <code>String</code></p><p><br>The longitude of the location.</p>                                                                               |
|                                 mkt                                |                                                                 <p>Type: <code>String</code></p><p><br>The market from which the results originate (e.g., en-US).</p>                                                                 |
|                                 cc                                 |        <p>Type: <code>String</code></p><p><br>Default: <code>"us"</code> <br>Name of the country. The name should be in <a href="https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes">ISO 3166 Alpha-2</a> format.</p>       |
|                                first                               |       <p>Type: <code>String</code></p><p><br>The parameter controls the offset of the organic results, defaulting to 1. For example, setting <code>first=10</code> will move the 10th organic result to the first position.</p>       |
|                                count                               |                                                                             <p>Type: <code>Number(Integer)</code> <br><br>Number of results per page.</p>                                                                             |
|                             safeSearch                             | <p>Type: String <code>\[off/moderate/strict]</code></p><p><br>Default: <code>off</code> <br><br>To filter the adult content set <code>safeSearch</code> to <code>moderate/strict</code> or to disable it set it <code>off</code>.</p> |
|                               filters                              |                                                                                    <p>Type: <code>String</code></p><p><br>Bing Search Filters.</p>                                                                                    |

### Bing Search API Example:

{% tabs %}
{% tab title="cURL" %}

```json
cURL "https://api.serpdog.io/bing_search?api_key=APIKEY&q=coffee+making+tutorial"
```

{% endtab %}

{% tab title="Node JS" %}

```javascript
const axios = require('axios');

axios.get('https://api.serpdog.io/bing_search?api_key=APIKEY&q=coffee+making+tutorial')
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.log(error);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
payload = {'api_key': 'APIKEY', 'q':'coffee+making+tutorial'}
resp = requests.get('https://api.serpdog.io/bing_search', params=payload)
print (resp.text)
```

{% endtab %}

{% tab title="Java" %}

```java
try {
 String url = "https://api.serpdog.io/bing_search?api_key=APIKEY&q=coffee+making+tutorial";
 URL urlForGetRequest = new URL(url);
 String readLine = null;
 HttpURLConnection conection = (HttpURLConnection) urlForGetRequest.openConnection();
 conection.setRequestMethod("GET");
 int responseCode = conection.getResponseCode();
 if (responseCode == HttpURLConnection.HTTP_OK) {
 BufferedReader in = new BufferedReader(new InputStreamReader(conection.getInputStream()));
 StringBuffer response = new StringBuffer();
 while ((readLine = in.readLine()) != null) {
 response.append(readLine);
 }
 in.close();
 System.out.println(response.toString());
} else {
 throw new Exception("Error in API Call");
 }
} catch (Exception ex) {
 ex.printStackTrace();
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'json'
params = {
 :api_key => "APIKEY",
 :q=> "coffee+making+tutorial"
}
uri = URI('https://api.serpdog.io/bing_search')
uri.query = URI.encode_www_form(params)
website_content = Net::HTTP.get(uri)
print(website_content)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "https://api.serpdog.io/bing_search?api_key=APIKEY&q=coffee+making+tutorial";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
print_r($response);
```

{% endtab %}
{% endtabs %}

```json
{
     "bing_data": [
    {
      "title": "Barista Coffee Making - Training for Beginners - YouTube",
      "displayed_link": "https://www.youtube.com/watch?v=1aK--s4Fq2Q",
      "link": "https://www.youtube.com/watch?v=1aK--s4Fq2Q",
      "snippet": "May 15, 2021 · A simple coffee making tutorial on what matters most - consistency. Keep it simple, focus on getting the basics right, then practice, practice and practice s...",
      "rank": 1,
      "extensions": [
        {
          "title": "",
          "snippet": ""
        },
        {
          "title": "",
          "snippet": ""
        }
      ],
      "images": [
        
      ]
    },
    {
      "title": "How to Make Perfect Coffee: 14 Steps (with Pictures) - wikiHow",
      "displayed_link": "https://www.wikihow.com/Make-Perfect-Coffee",
      "link": "https://www.wikihow.com/Make-Perfect-Coffee",
      "snippet": "Brew with a French press.Many experts favor this method, but it can take some practice to avoid bitter over-extraction. Here's how to make coffee magic:Remove the lid and plunger.Add the coffee. Use two tablespoons (30 mL) for a one-serving press, or fill to the mark on the side of the press.See more on wikihow.com",
      "rank": 2,
      "extensions": [
        {
          "title": "",
          "snippet": ""
        },
        {
          "title": "",
          "snippet": ""
        },
        {
          "title": "",
          "snippet": ""
        }
      ],
      "images": [
        
      ]
    },
    {
      "title": "A Beginner's Guide to Brewing Coffee at Home (Step by Step)",
      "displayed_link": "https://yourdreamcoffee.com/beginners-guide-to-brewing-coffee",
      "link": "https://yourdreamcoffee.com/beginners-guide-to-brewing-coffee/",
      "snippet": "Or on top of the coffee server when using one. Place the ground coffee in the middle of the coffee filter and make a small hole in the middle. Pour 1/4th of the total water on top of …",
      "rank": 3,
      "images": [
        
      ]
    },
    {
      "title": "How to Make Coffee for Beginners – The Ultimate Guide",
      "displayed_link": "https://www.brewcoffeedaily.com/guides/brewing/how-to-make-coff…",
      "link": "https://www.brewcoffeedaily.com/guides/brewing/how-to-make-coffee-for-beginners/",
      "snippet": "The ideal coffee-to-water ratio is between 1:15 to 1:18, depending on personal taste preferences. Heat your water to the desired temperature. The ideal water temperature is …",
      "rank": 4,
      "images": [
        
      ]
    },
    {
      "title": "A Beginner's Guide to Making Great Coffee - YouTube",
      "displayed_link": "https://www.youtube.com/watch?v=ZCXG0BCFLNA",
      "link": "https://www.youtube.com/watch?v=ZCXG0BCFLNA",
      "snippet": "In this video, I show you everything you need to know in order to start making GREAT coffee.Trade Coffee Subscription (get your first bag free): http://s.trd...",
      "rank": 5,
      "images": [
        
      ]
    },
    {
      "title": "Coffee Brewing For Beginners(and learn how to make your first",
      "displayed_link": "https://www.youtube.com/watch?v=uoj7bsHlt6M",
      "link": "https://www.youtube.com/watch?v=uoj7bsHlt6M",
      "snippet": "There's coffee, and there's good coffee. Luckily good coffee is very easy to make as long as you get three basics right.1) Use freshly roasted coffee beans a...",
      "rank": 6,
      "images": [
        
      ]
    },
    {
      "title": "How to Make Good Coffee According to a Barista: 4 Tricks - Primer",
      "displayed_link": "https://www.primermagazine.com/2020/learn/how-to-make-better-c…",
      "link": "https://www.primermagazine.com/2020/learn/how-to-make-better-coffee-at-home",
      "snippet": "Best Coffee Water Temperature. Water temperature is also important. The optimal temperature you want to brew your coffee is 195 ° -205 ° F. A good rule of thumb to …",
      "rank": 7,
      "images": [
        
      ]
    },
    {
      "title": "How to Make Coffee at Home - Coffee Brewing Methods",
      "displayed_link": "https://www.popularmechanics.com/home/food-drink/a27309629/how-t…",
      "link": "https://www.popularmechanics.com/home/food-drink/a27309629/how-to-make-coffee/",
      "snippet": "Pour-Over. Grind: Medium-coarse. Time: 2.5 to 3 minutes. How to do it: Measure grounds into paper filter in brew basket. Pour a little hot water and let the grounds bloom (expand …",
      "rank": 8,
      "images": [
        
      ]
    }
  ],
}
```
