> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Access API directly

> How to access the API client directly using Laravel Scout with Algolia Scout Extended.

To access the API directly, you may need to interact with [Algolia's PHP client](/doc/libraries/sdk).

The Algolia PHP client lets you use Algolia's features in the most customizable way possible.

<Note>
  Before you access the Algolia's PHP client directly,
  make sure that there aren't any breaking changes:

  ```sh Command line icon=square-terminal theme={"system"}
  composer require algolia/algoliasearch-client-php
  ```
</Note>

#### `Algolia::client`

The `client` method returns an instance of `Algolia\AlgoliaSearch\SearchClient`:

```php PHP icon=code theme={"system"}
use Algolia\ScoutExtended\Facades\Algolia;

$client = Algolia::client();

$apiKeys = $client->listApiKeys();
$indices = $client->listIndices();
$client->copyIndex('indexNameSrc', 'indexNameDest');
$client->moveIndex('indexNameSrc', 'indexNameDest');
// ...
```

#### `Algolia::index`

The `index` method returns an instance of `Algolia\AlgoliaSearch\SearchIndex`:

```php PHP icon=code theme={"system"}
use Algolia\ScoutExtended\Facades\Algolia;

$index = Algolia::index(App\Article::class);

$synonym = $index->getSynonym('a-unique-identifier');
$rule = $index->getRule('a-unique-identifier');
$index->delete();
// ...
```

#### `Algolia::analytics`

The `analytics` method returns an instance of `Algolia\AlgoliaSearch\AnalyticsClient`:

```php PHP icon=code theme={"system"}
use Algolia\ScoutExtended\Facades\Algolia;

$analytics = Algolia::analytics();
$test = $analytics->getABTest('a-unique-identifier');
// ...
```
