Brave Web Search API is a REST API to query Brave Search and get back search results from the web. The following sections describe how to curate requests, including parameters and headers, to Brave Web Search API and get a JSON response back. This package provides a convenient wrapper to the Brave Web Search API for Laravel applications.
- PHP 8.0+
- Laravel 10.x
To install this package tou can use composer:
composer require slvler/brave-search-api
- First, you should extract the config/brave.php file to the config folder.
php artisan vendor:publish --tag=brave
- First of all we'll add the API key and API Url of the service we're using to our .env file of our project. If you don't have an account yet on api.search.brave.com, you should create one. Once you have an account you can copy your API key from the dashboard page and put it into you .env file.
BRAVE_BASE_URL="https://api.search.brave.com"
BRAVE_API_KEY=
- You can use it to search on brave api:
use Slvler\Brave\Facades\Brave;
Brave::web(['q' => "bitcoin"])->result();
composer test
The MIT License (MIT). Please see License File for more information.
You're very welcome to contribute. Please see CONTRIBUTING for details.