UniProtPHPClass

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.

Features

Protein Entry Retrieval

Retrieve complete UniProtKB entries using accession numbers.

Advanced Search

Search UniProtKB using the full UniProt query language with automatic pagination.

ID Mapping

Convert identifiers between UniProt, Ensembl, RefSeq, Gene Names and many other databases.

Multiple Formats

Retrieve responses as JSON, FASTA, XML, TSV and GFF.

Automatic HTTP Transport

Automatically selects cURL when available and falls back to PHP Streams.

Pure PHP

No Composer, frameworks or third-party dependencies required.

Quick Start

<?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'];

Library Components

UniProtEntry

Retrieve single protein entries, batch entries and specific fields from UniProtKB.

UniProtSearch

Search UniProtKB using complex queries with transparent cursor-based pagination.

UniProtIdMapping

Submit asynchronous ID mapping jobs and retrieve results automatically.

Highlights