typesense/typesense-php

PHP client for Typesense: https://github.com/typesense/typesense

PHP

273

270 commits

updated Sep 10, 2026

See the code

README

Typesense PHP Client

Official PHP client for the Typesense API: https://github.com/typesense/typesense

Installation

composer require php-http/curl-client typesense/typesense-php

You can also add typesense/typesense-php to your project's composer.json.

Typesense uses HTTPlug as an abstraction layer for an HTTP client. You'll find the List of supported HTTP clients & adapters here. Please be sure to install a supported client.

Usage

Read the documentation here: https://typesense.org/api/

Here are some examples that walk you through how to use the client: doc/examples

Escaping filter values

Use Typesense\FilterBy::escapeString() to safely use string values in filter_by:

use Typesense\FilterBy;

$filterValue = "The 17\" O'Conner && O`Series \n OR a || 1%2 book? (draft), [alpha]";
$filterBy = 'tags:=' . FilterBy::escapeString($filterValue);

Compatibility

Typesense Servertypesense-php
>= v30.0>= v6.0.0
>= v28.0>= v5.0.0
>= v26.0>= v4.9.0
>= v0.23.0>= v4.8.0
>= v0.21.0>= v4.7.0
>= v0.20.0>= v4.6.0
>= v0.19.0>= v4.5.0
>= v0.18.0>= v4.4.0
>= v0.17.0>= v4.2.0
>= v0.16.0>= v4.1.0
>= v0.15.0>= v4.0.0

Contributing

Bug reports and pull requests are welcome on GitHub at [https://github.com/typesense/typesense-php].

Development

Run linter:

composer run-script lint:fix

Run Typesense Server:

composer run-script typesenseServer

Run tests:

docker compose up
cp phpunit.xml.dist phpunit.xml
composer run-script test

Credits

This client was originally developed by Abdullah Al-Faqeir from DevLoops and was adopted as the official PHP client library for Typesense in Oct 2020.

Ongoing development and support is now provided by Typesense, in addition to our collaborators.

php-client
search
typesense
typesense-php

typesense/typesense-php

PHP client for Typesense: https://github.com/typesense/typesense

PHP

273

270 commits

updated Sep 10, 2026

See the code

README

Typesense PHP Client

Official PHP client for the Typesense API: https://github.com/typesense/typesense

Installation

composer require php-http/curl-client typesense/typesense-php

You can also add typesense/typesense-php to your project's composer.json.

Typesense uses HTTPlug as an abstraction layer for an HTTP client. You'll find the List of supported HTTP clients & adapters here. Please be sure to install a supported client.

Usage

Read the documentation here: https://typesense.org/api/

Here are some examples that walk you through how to use the client: doc/examples

Escaping filter values

Use Typesense\FilterBy::escapeString() to safely use string values in filter_by:

use Typesense\FilterBy;

$filterValue = "The 17\" O'Conner && O`Series \n OR a || 1%2 book? (draft), [alpha]";
$filterBy = 'tags:=' . FilterBy::escapeString($filterValue);

Compatibility

Typesense Servertypesense-php
>= v30.0>= v6.0.0
>= v28.0>= v5.0.0
>= v26.0>= v4.9.0
>= v0.23.0>= v4.8.0
>= v0.21.0>= v4.7.0
>= v0.20.0>= v4.6.0
>= v0.19.0>= v4.5.0
>= v0.18.0>= v4.4.0
>= v0.17.0>= v4.2.0
>= v0.16.0>= v4.1.0
>= v0.15.0>= v4.0.0

Contributing

Bug reports and pull requests are welcome on GitHub at [https://github.com/typesense/typesense-php].

Development

Run linter:

composer run-script lint:fix

Run Typesense Server:

composer run-script typesenseServer

Run tests:

docker compose up
cp phpunit.xml.dist phpunit.xml
composer run-script test

Credits

This client was originally developed by Abdullah Al-Faqeir from DevLoops and was adopted as the official PHP client library for Typesense in Oct 2020.

Ongoing development and support is now provided by Typesense, in addition to our collaborators.

php-client
search
typesense
typesense-php

Significant stargazers

Jürgen

48 followers · starred Apr 2025

Brandon Surowiec

30 followers · starred Jul 2024

Oliver

11 followers · starred Feb 2021