PHPackages                             darcher/pinecone-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. darcher/pinecone-php

ActiveLibrary[API Development](/categories/api)

darcher/pinecone-php
====================

Pinecode API Client in PHP

123PHP

Since Apr 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/danielarcher/pinecone-php)[ Packagist](https://packagist.org/packages/darcher/pinecone-php)[ RSS](/packages/darcher-pinecone-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Pinecone API Client
=======================

[](#php-pinecone-api-client)

This PHP Pinecone API Client is a powerful and easy-to-use library that allows you to interact with the Pinecone vector database. Pinecone is a scalable and high-performance vector database designed to store, search, and manage large volumes of high-dimensional vectors.

This library offers a convenient and efficient way to interact with Pinecone using PHP.

Getting Started
---------------

[](#getting-started)

### Prerequisites

[](#prerequisites)

To use this package, you will need to have PHP 8.1 or higher installed on your machine. You will also need to have a Pinecone account and an API key.

### Installation

[](#installation)

To install the package, you can use composer:

```
composer require darcher/pinecone-php
```

Usage
=====

[](#usage)

Index
-----

[](#index)

To get started, you will need to create an instance of the IndexApi class:

```
use Darcher\PineconePhp\IndexApi;

$apiKey = 'your-api-key';
$environment = 'us-west1-gcp';

$pinecone = IndexApi::build($apiKey, $environment);
```

Once you have an instance of the IndexApi class, you can use it to perform various operations on your Pinecone indexes. For example, you can list all of your indexes:

```
$indexes = $pinecone->list();
```

You can also create a new index:

```
$name = 'my-new-index';
$dimension = 256;

$response = $pinecone->create($name, $dimension);
```

For more information on the available methods and their parameters, please refer to the inline documentation in the IndexApi class.

Usage To get started, you will need to create an instance of the VectorApi class:

Vectors
-------

[](#vectors)

If you don't know the host

```
use Darcher\PineconePhp\VectorApi;

$apiKey = 'your-api-key';
$environment = 'us-west1-gcp';
$indexName = 'your-index-name';

$pinecone = VectorApi::build($apiKey, null, $indexName, $environment);
```

Once you have an instance of the VectorApi class, you can use it to perform various operations on your Pinecone vectors. For example, you can query vectors by their ID:

```
$id = 'your-vector-id';
$topK = 10;

$response = $pinecone->queryById($id, $topK);
```

You can also upsert a collection of vectors:

```
use Darcher\PineconePhp\Vector;
use Darcher\PineconePhp\VectorCollection;

$vectors = new VectorCollection([
    new Vector('vector-id-1', [1, 2, 3]),
    new Vector('vector-id-2', [4, 5, 6]),
]);

$response = $pinecone->upsertCollection($vectors);
```

Or using the factory class

```
use Darcher\PineconePhp\VectorCollectionFactory;

$response = $pinecone->upsertCollection(VectorCollectionFactory::create([
    ['vector-id-1', [1, 2, 3]],
    ['vector-id-2', [3, 4, 5]],
]));
```

You can also use the upsert for a single vector

```
use Darcher\PineconePhp\Vector;

$response = $pinecone->upsertOne(new Vector('vector-id-1', [1, 2, 3]));
```

For more information on the available methods and their parameters, please refer to the inline documentation in the VectorApi class.

Contributing
============

[](#contributing)

If you would like to contribute to this package, please feel free to open a pull request or an issue on the GitHub repository.

License
=======

[](#license)

This package is licensed under the MIT License.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d54e299c7461fc864528312a76a33756747ddd7dcb5dd11c7d6c4a6193dafc2?d=identicon)[danielarcher](/maintainers/danielarcher)

---

Top Contributors

[![danielarcher](https://avatars.githubusercontent.com/u/2718444?v=4)](https://github.com/danielarcher "danielarcher (2 commits)")

### Embed Badge

![Health badge](/badges/darcher-pinecone-php/health.svg)

```
[![Health](https://phpackages.com/badges/darcher-pinecone-php/health.svg)](https://phpackages.com/packages/darcher-pinecone-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
