A lightweight, dependency-free PHP library for interacting with the UniProt REST API. Retrieve protein entries, perform advanced searches, map identifiers between biological databases, and download data in multiple formats through a simple object-oriented API.
Retrieve complete UniProtKB entries using accession numbers.
Search UniProtKB using the full UniProt query language with automatic pagination.
Convert identifiers between UniProt, Ensembl, RefSeq, Gene Names and many other databases.
Retrieve responses as JSON, FASTA, XML, TSV and GFF.
Automatically selects cURL when available and falls back to PHP Streams.
No Composer, frameworks or third-party dependencies required.
<?php
require_once 'src/autoload.php';
use UniProtPHP\Http\HttpClientFactory;
use UniProtPHP\UniProt\UniProtEntry;
$httpClient = HttpClientFactory::create();
$entry = new UniProtEntry($httpClient);
$protein = $entry->get('P12345');
echo $protein['primaryAccession'];
Retrieve single protein entries, batch entries and specific fields from UniProtKB.
Search UniProtKB using complex queries with transparent cursor-based pagination.
Submit asynchronous ID mapping jobs and retrieve results automatically.