PHPackages                             jamesfrost/wikidata - 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. jamesfrost/wikidata

ActiveLibrary

jamesfrost/wikidata
===================

A PHP client for working with Wikidata API.

1.0.2(9y ago)22.7k2MITPHPPHP &gt;=5.4.0

Since Aug 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/JamesFrost/wikidata)[ Packagist](https://packagist.org/packages/jamesfrost/wikidata)[ Docs](https://github.com/freearhey/wikidata)[ RSS](/packages/jamesfrost-wikidata/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (6)Used By (0)

Wikidata
========

[](#wikidata)

Wikidata provides a API for searching and retrieving data from [wikidata.org](https://www.wikidata.org).

### Installation

[](#installation)

```
composer require freearhey/wikidata
```

### Usage

[](#usage)

```
$wikidata = new Wikidata;
```

#### Search

[](#search)

Search by entity title:

```
$result = $wikidata->search('steve jobs');
```

Check if no search results

```
if($result->isEmpty()) {
	echo 'no results';
	die();
}
```

Retrieve first entity in result list

```
$singleResult = $result->first();
```

Retrieve all results

```
$allResults = $result->get();
```

Get entity id

```
$entityId = $singleResult->getEntityId(); // Q26
```

#### Entities

[](#entities)

Get single entity by id:

```
$entities = $wikidata->entities('Q26');
```

Get single entity with preset language (default: en)

```
$entities = $wikidata->entities('Q26', 'fr');
```

Get few entities by id and more languages

```
$entities = $wikidata->entities('Q26|Q106', 'en|fr|ch');
```

Retrieve first entity

```
$entity = $entities->first();
```

Get all entities

```
$entity = $entities->get();
```

Get single entity by id

```
$entity = $entities->get('Q26');
```

Get entity label and description (default language: en)

```
$label = $entity->getLabel(); // Steve Jobs
$description = $entity->getDescription('de'); // US-amerikanischer Unternehmer, Mitbegründer von Apple Computer
```

Get entity property values by property id (e.g. P21) if it exists. All list properties you can find [here](https://www.wikidata.org/wiki/Wikidata:List_of_properties)

```
$gender = $entity->getPropertyValues('P21'); // array(1) { [0]=> string(4) "male" }
```

And with language property (default: en)

```
$childs = $entity->getPropertyValues('P40', 'ru'); // array(1) { [0]=> string(35) "Бреннан-Джобс, Лиза" }
```

That's all.

### License

[](#license)

Wikidata is licensed under the [MIT license](https://github.com/freearhey/wikidata/blob/master/LICENSE)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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.

###  Release Activity

Cadence

Every ~122 days

Total

2

Last Release

3358d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a72ca6ba61ada54bd192f214996f493007128b3b6e3bb62d1b016207002c805?d=identicon)[JamesFrost](/maintainers/JamesFrost)

---

Top Contributors

[![JamesFrost](https://avatars.githubusercontent.com/u/6696197?v=4)](https://github.com/JamesFrost "JamesFrost (12 commits)")[![freearhey](https://avatars.githubusercontent.com/u/7253922?v=4)](https://github.com/freearhey "freearhey (7 commits)")[![d3f3kt](https://avatars.githubusercontent.com/u/5670972?v=4)](https://github.com/d3f3kt "d3f3kt (1 commits)")

---

Tags

phpclientwikidata

### Embed Badge

![Health badge](/badges/jamesfrost-wikidata/health.svg)

```
[![Health](https://phpackages.com/badges/jamesfrost-wikidata/health.svg)](https://phpackages.com/packages/jamesfrost-wikidata)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[freearhey/wikidata

A PHP client for working with Wikidata API.

5628.6k](/packages/freearhey-wikidata)[ebics-api/ebics-client-php

PHP library to communicate with bank through EBICS protocol.

6411.1k](/packages/ebics-api-ebics-client-php)[automattic/wistia-php

PHP wrapper for Wistia API

1431.9k](/packages/automattic-wistia-php)

PHPackages © 2026

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