PHPackages                             nixler/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. [API Development](/categories/api)
4. /
5. nixler/wikidata

ActiveLibrary[API Development](/categories/api)

nixler/wikidata
===============

Laravel PHP Facade/Wrapper for the Wikidata Data API

014PHP

Since Feb 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Nixler/Wikidata)[ Packagist](https://packagist.org/packages/nixler/wikidata)[ RSS](/packages/nixler-wikidata/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Wikidata
========

[](#wikidata)

[![Travis Wikidata Build](https://camo.githubusercontent.com/7a68a45cf378103ca00c8ab8c2e6c51d89ae9923004ce29be4bc4d560d7084ec/68747470733a2f2f6170692e7472617669732d63692e6f72672f6e69786c65722f57696b69646174612e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/7a68a45cf378103ca00c8ab8c2e6c51d89ae9923004ce29be4bc4d560d7084ec/68747470733a2f2f6170692e7472617669732d63692e6f72672f6e69786c65722f57696b69646174612e7376673f6272616e63683d6d6173746572)

Laravel PHP Facade/Wrapper for the Wikidata Data API

Installation
------------

[](#installation)

Add `nixler/wikidata` to your `composer.json`.

```
"nixler/wikidata": "dev-master"

```

Run `composer update` to pull down the latest version of the package.

Next, you should add the WikidataServiceProvider to the providers array of your config/app.php configuration file:

```
Nixler\Wikidata\WikidataServiceProvider::class,
```

After registering the Wikidata service provider, you should publish the Wikidata configuration using the vendor:publish Artisan command. This command will publish the wikidata.php configuration file to your config directory:

```
php artisan vendor:publish --provider="Nixler\Wikidata\WikidataServiceProvider"

```

Usage
-----

[](#usage)

```
use Nixler\Wikidata\Wikidata;
...

// Retrieving Entities By ID
$laravel = (new Wikidata)->whereId('Q13634357')->first();
// or by array of IDs
$companies = (new Wikidata)->whereId(['Q95', 'Q2283'])->get();

//Languages
$laravel = (new Wikidata)->whereId('Q13634357')->languages('en', 'ru')->get();

//Select Clause
$laravel = (new Wikidata)->select('id', 'label')->whereId('Q13634357')->first();
//available attributes id, label, description, wiki, type, aliases, sitelinks, claims, photos

//Search By Query
$search = (new Wikidata)->search('Adele')->get();

//Search By Prop
$adele = (new Wikidata)->where('P345', 'nm2233157')->first();
```

Wikidata Data API
-----------------

[](#wikidata-data-api)

- [MediaWiki API help](https://www.wikidata.org/w/api.php)

\#Map

for first there should be functionality to add just title, headline, type, wiki, photos

Write Model has Enitable trait We make opperation $model-&gt;entity()-&gt;fetch('wikidata', 'Q1'); or $model-&gt;fetchDataFrom('lastfm', 'Adele'); or $model-&gt;fetchDataFrom('gbooks', 'Some book'); or $model-&gt;fetchDataFrom('tmdb', 'ID'); or $model-&gt;fetchDataFrom('imdb', 'ID'); or $model-&gt;fetchDataFrom('youtube', 'Some song or video'); entity if not exists it creates new and associates current external IDs Then system make update of entity, it fetches all relations and populates entity with data.

Read $model-&gt;getData(\[ 'info' =&gt; 'id,type,title,headline,wiki,entities', 'links' =&gt; 'facebook,twitter', 'photos' =&gt; 20, 'similars' =&gt; 5 \]);

takes info (translated), links to profiles in social networks, similars, photos in entities it takes structured data such as \['date\_of\_birth' =&gt; 'timestamp'\]

there should be write opperation file for each type of entity - person, music, book, album, country

Search should be performed this way - entities('country')-&gt;where('')

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community1

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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

### Embed Badge

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

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

###  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)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

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

PHP wrapper for the Meilisearch API

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

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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