Skip to content

Latest commit

 

History

History
831 lines (674 loc) · 28.4 KB

File metadata and controls

831 lines (674 loc) · 28.4 KB

ScrapeBadger.Api.BingApi

All URIs are relative to https://scrapebadger.com

Method HTTP request Description
BingBingScraperHealthCheck GET /v1/bing/health Bing scraper health check
BingBingScraperHealthCheckHead HEAD /v1/bing/health Bing scraper health check
BingImageSearch GET /v1/bing/images Image search
BingListSupportedMarkets GET /v1/bing/markets List supported markets
BingNewsSearch GET /v1/bing/news News search
BingSearchSuggestions GET /v1/bing/autocomplete Search suggestions
BingVideoSearch GET /v1/bing/videos Video search
BingWebSearch GET /v1/bing/search Web search

BingBingScraperHealthCheck

Object BingBingScraperHealthCheck ()

Bing scraper health check

Check health of the Bing scraper service (accepts HEAD for UptimeRobot).

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using ScrapeBadger.Api;
using ScrapeBadger.Client;
using ScrapeBadger.Model;

namespace Example
{
    public class BingBingScraperHealthCheckExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://scrapebadger.com";
            // Configure API key authorization: ApiKeyAuth
            config.AddApiKey("X-API-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Key", "Bearer");

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new BingApi(httpClient, config, httpClientHandler);

            try
            {
                // Bing scraper health check
                Object result = apiInstance.BingBingScraperHealthCheck();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BingApi.BingBingScraperHealthCheck: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BingBingScraperHealthCheckWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Bing scraper health check
    ApiResponse<Object> response = apiInstance.BingBingScraperHealthCheckWithHttpInfo();
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BingApi.BingBingScraperHealthCheckWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

Object

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BingBingScraperHealthCheckHead

Object BingBingScraperHealthCheckHead ()

Bing scraper health check

Check health of the Bing scraper service (accepts HEAD for UptimeRobot).

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using ScrapeBadger.Api;
using ScrapeBadger.Client;
using ScrapeBadger.Model;

namespace Example
{
    public class BingBingScraperHealthCheckHeadExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://scrapebadger.com";
            // Configure API key authorization: ApiKeyAuth
            config.AddApiKey("X-API-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Key", "Bearer");

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new BingApi(httpClient, config, httpClientHandler);

            try
            {
                // Bing scraper health check
                Object result = apiInstance.BingBingScraperHealthCheckHead();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BingApi.BingBingScraperHealthCheckHead: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BingBingScraperHealthCheckHeadWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Bing scraper health check
    ApiResponse<Object> response = apiInstance.BingBingScraperHealthCheckHeadWithHttpInfo();
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BingApi.BingBingScraperHealthCheckHeadWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

Object

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BingImageSearch

Object BingImageSearch (string query, string market = null, int? count = null, string safeSearch = null)

Image search

Bing Images — thumbnail, full-size and source URL per result.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using ScrapeBadger.Api;
using ScrapeBadger.Client;
using ScrapeBadger.Model;

namespace Example
{
    public class BingImageSearchExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://scrapebadger.com";
            // Configure API key authorization: ApiKeyAuth
            config.AddApiKey("X-API-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Key", "Bearer");

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new BingApi(httpClient, config, httpClientHandler);
            var query = "query_example";  // string | Search keywords, e.g. 'golden retriever'
            var market = "\"en-US\"";  // string | Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (optional)  (default to "en-US")
            var count = 35;  // int? | Results to return (optional)  (default to 35)
            var safeSearch = "safeSearch_example";  // string | off | moderate | strict (optional) 

            try
            {
                // Image search
                Object result = apiInstance.BingImageSearch(query, market, count, safeSearch);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BingApi.BingImageSearch: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BingImageSearchWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Image search
    ApiResponse<Object> response = apiInstance.BingImageSearchWithHttpInfo(query, market, count, safeSearch);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BingApi.BingImageSearchWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
query string Search keywords, e.g. 'golden retriever'
market string Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. [optional] [default to "en-US"]
count int? Results to return [optional] [default to 35]
safeSearch string off moderate

Return type

Object

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BingListSupportedMarkets

Object BingListSupportedMarkets ()

List supported markets

Supported Bing market codes. Free — costs no credits.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using ScrapeBadger.Api;
using ScrapeBadger.Client;
using ScrapeBadger.Model;

namespace Example
{
    public class BingListSupportedMarketsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://scrapebadger.com";
            // Configure API key authorization: ApiKeyAuth
            config.AddApiKey("X-API-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Key", "Bearer");

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new BingApi(httpClient, config, httpClientHandler);

            try
            {
                // List supported markets
                Object result = apiInstance.BingListSupportedMarkets();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BingApi.BingListSupportedMarkets: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BingListSupportedMarketsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List supported markets
    ApiResponse<Object> response = apiInstance.BingListSupportedMarketsWithHttpInfo();
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BingApi.BingListSupportedMarketsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

Object

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BingNewsSearch

Object BingNewsSearch (string query, string market = null, string freshness = null)

News search

Bing News — headline, source, published time and snippet per article.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using ScrapeBadger.Api;
using ScrapeBadger.Client;
using ScrapeBadger.Model;

namespace Example
{
    public class BingNewsSearchExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://scrapebadger.com";
            // Configure API key authorization: ApiKeyAuth
            config.AddApiKey("X-API-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Key", "Bearer");

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new BingApi(httpClient, config, httpClientHandler);
            var query = "query_example";  // string | Search keywords, e.g. 'interest rates'
            var market = "\"en-US\"";  // string | Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (optional)  (default to "en-US")
            var freshness = "freshness_example";  // string | day | week | month — restrict to recent articles (optional) 

            try
            {
                // News search
                Object result = apiInstance.BingNewsSearch(query, market, freshness);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BingApi.BingNewsSearch: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BingNewsSearchWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // News search
    ApiResponse<Object> response = apiInstance.BingNewsSearchWithHttpInfo(query, market, freshness);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BingApi.BingNewsSearchWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
query string Search keywords, e.g. 'interest rates'
market string Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. [optional] [default to "en-US"]
freshness string day week

Return type

Object

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BingSearchSuggestions

Object BingSearchSuggestions (string query, string market = null)

Search suggestions

Bing search-box query suggestions.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using ScrapeBadger.Api;
using ScrapeBadger.Client;
using ScrapeBadger.Model;

namespace Example
{
    public class BingSearchSuggestionsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://scrapebadger.com";
            // Configure API key authorization: ApiKeyAuth
            config.AddApiKey("X-API-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Key", "Bearer");

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new BingApi(httpClient, config, httpClientHandler);
            var query = "query_example";  // string | Partial search term, e.g. 'coff'
            var market = "\"en-US\"";  // string | Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (optional)  (default to "en-US")

            try
            {
                // Search suggestions
                Object result = apiInstance.BingSearchSuggestions(query, market);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BingApi.BingSearchSuggestions: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BingSearchSuggestionsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Search suggestions
    ApiResponse<Object> response = apiInstance.BingSearchSuggestionsWithHttpInfo(query, market);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BingApi.BingSearchSuggestionsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
query string Partial search term, e.g. 'coff'
market string Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. [optional] [default to "en-US"]

Return type

Object

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BingVideoSearch

Object BingVideoSearch (string query, string market = null, int? count = null, string safeSearch = null)

Video search

Bing Videos — title, thumbnail, duration, publisher and source per result.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using ScrapeBadger.Api;
using ScrapeBadger.Client;
using ScrapeBadger.Model;

namespace Example
{
    public class BingVideoSearchExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://scrapebadger.com";
            // Configure API key authorization: ApiKeyAuth
            config.AddApiKey("X-API-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Key", "Bearer");

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new BingApi(httpClient, config, httpClientHandler);
            var query = "query_example";  // string | Search keywords, e.g. 'espresso tutorial'
            var market = "\"en-US\"";  // string | Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (optional)  (default to "en-US")
            var count = 35;  // int? | Results to return (optional)  (default to 35)
            var safeSearch = "safeSearch_example";  // string | off | moderate | strict (optional) 

            try
            {
                // Video search
                Object result = apiInstance.BingVideoSearch(query, market, count, safeSearch);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BingApi.BingVideoSearch: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BingVideoSearchWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Video search
    ApiResponse<Object> response = apiInstance.BingVideoSearchWithHttpInfo(query, market, count, safeSearch);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BingApi.BingVideoSearchWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
query string Search keywords, e.g. 'espresso tutorial'
market string Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. [optional] [default to "en-US"]
count int? Results to return [optional] [default to 35]
safeSearch string off moderate

Return type

Object

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BingWebSearch

Object BingWebSearch (string query, string market = null, int? count = null, int? offset = null, string safeSearch = null)

Web search

Bing web SERP — organic results, ads, related searches and total count.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using ScrapeBadger.Api;
using ScrapeBadger.Client;
using ScrapeBadger.Model;

namespace Example
{
    public class BingWebSearchExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://scrapebadger.com";
            // Configure API key authorization: ApiKeyAuth
            config.AddApiKey("X-API-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Key", "Bearer");

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new BingApi(httpClient, config, httpClientHandler);
            var query = "query_example";  // string | Search keywords, e.g. 'coffee machine'
            var market = "\"en-US\"";  // string | Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (optional)  (default to "en-US")
            var count = 10;  // int? | Results per page (1-50) (optional)  (default to 10)
            var offset = 0;  // int? | Zero-based result offset for pagination (optional)  (default to 0)
            var safeSearch = "safeSearch_example";  // string | off | moderate | strict (default moderate) (optional) 

            try
            {
                // Web search
                Object result = apiInstance.BingWebSearch(query, market, count, offset, safeSearch);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BingApi.BingWebSearch: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BingWebSearchWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Web search
    ApiResponse<Object> response = apiInstance.BingWebSearchWithHttpInfo(query, market, count, offset, safeSearch);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BingApi.BingWebSearchWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
query string Search keywords, e.g. 'coffee machine'
market string Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. [optional] [default to "en-US"]
count int? Results per page (1-50) [optional] [default to 10]
offset int? Zero-based result offset for pagination [optional] [default to 0]
safeSearch string off moderate

Return type

Object

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]