# swagger-client
The Brave Web Search API allows developers to integrate web search capabilities from the Brave Search engine into their applications.  It supports querying Brave's index with advanced options for filtering, pagination, and customizing the search results format.  Designed for developers building tools like search engines, content discovery platforms, or analytics applications. 

This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 1.0.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

## Requirements.

Python 2.7 and 3.4+

## Installation & Usage
### pip install

If the python package is hosted on Github, you can install directly from Github

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import swagger_client 
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import swagger_client
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiKey
configuration = swagger_client.Configuration()
configuration.api_key['X-Subscription-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Subscription-Token'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))
q = 'q_example' # str | The search query term. Use this parameter to specify the topic, keywords, or phrases to search for in Brave's web index. Example: 'climate change impacts'. 
count = 20 # int | Specifies the number of search results to return per request, with a maximum value of 20.  Useful for controlling the number of items displayed in paginated lists. Example: 10.  (optional) (default to 20)
offset = 0 # int | The zero-based offset for paginating search results. Use this parameter to skip a number of results. For example, setting `offset=10` skips the first 10 results and retrieves the next set.  (optional) (default to 0)
safesearch = 'moderate' # str | A filter to control the inclusion of adult or explicit content in the search results. Options: - `off`: No filtering (all content types included). - `moderate`: Filters explicit images and videos (default). - `strict`: Strict filtering of adult content.  (optional) (default to moderate)
freshness = 'freshness_example' # str | Restricts search results based on when the content was indexed by Brave Search.  Options: - `pd`: Results from the past day. - `pw`: Results from the past week. - `pm`: Results from the past month. - `py`: Results from the past year.  (optional)
text_decorations = true # bool | Indicates whether to include highlighting or decoration markers (e.g., bolding keywords) in display strings for search results. Example: true (default).  (optional) (default to true)
spellcheck = true # bool | Enables or disables spellchecking for the query. When enabled, the API corrects misspelled words in the query to improve result relevance. Example: true (default).  (optional) (default to true)
result_filter = 'result_filter_example' # str | A comma-separated list of specific result types to include in the response. Examples: - `news,images` (to include only news articles and images).  (optional)
goggles_id = 'goggles_id_example' # str | Applies custom re-ranking logic on top of the Brave Search index.  Use this parameter with a valid `goggles_id` value for personalized results.  (optional)
units = 'units_example' # str | The preferred system of measurement for displaying unit-based content in search results. Options: - `metric`: Metric units (kilometers, kilograms, etc.). - `imperial`: Imperial units (miles, pounds, etc.).  (optional)
extra_snippets = true # bool | Allows the API to return up to 5 alternative excerpts for each result.  Useful for presenting users with multiple contexts or descriptions for a single item.  (optional)
summary = true # bool | Enables the generation of summary keys for web search results, providing concise overviews of the content.  (optional)

try:
    # Get detailed web search results
    api_response = api_instance.brave_search_get_web_search_results(q, count=count, offset=offset, safesearch=safesearch, freshness=freshness, text_decorations=text_decorations, spellcheck=spellcheck, result_filter=result_filter, goggles_id=goggles_id, units=units, extra_snippets=extra_snippets, summary=summary)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->brave_search_get_web_search_results: %s\n" % e)
```

## Documentation for API Endpoints

All URIs are relative to *https://api.search.brave.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**brave_search_get_web_search_results**](docs/DefaultApi.md#brave_search_get_web_search_results) | **GET** /res/v1/web/search | Get detailed web search results

## Documentation For Models

 - [InlineResponse200](docs/InlineResponse200.md)
 - [InlineResponse200Query](docs/InlineResponse200Query.md)
 - [InlineResponse200Web](docs/InlineResponse200Web.md)
 - [InlineResponse200WebResults](docs/InlineResponse200WebResults.md)

## Documentation For Authorization


## apiKey

- **Type**: API key
- **API key parameter name**: X-Subscription-Token
- **Location**: HTTP header


## Author


