PHPackages                             scholarly/providers - 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. scholarly/providers

ActiveLibrary[API Development](/categories/api)

scholarly/providers
===================

Unified PHP SDK for scholarly data providers with adapters, caching, and graph exporter.

v1.0.1(7mo ago)07MITPHPPHP ^8.3CI failing

Since Oct 2Pushed 7mo agoCompare

[ Source](https://github.com/mbsoft31/scholarly-providers)[ Packagist](https://packagist.org/packages/scholarly/providers)[ Docs](https://github.com/mbsoft31/scholarly-providers)[ RSS](/packages/scholarly-providers/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (21)Versions (3)Used By (0)

scholarly/providers
===================

[](#scholarlyproviders)

[![PHP Version](https://camo.githubusercontent.com/e69fc10ad0d3845d44d08b0eeedd6dd7a5bfa4ab872e68e26b131554122d35d5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e332d626c75652e737667)](https://php.net)[![License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Latest Version on Packagist](https://camo.githubusercontent.com/de97d5b3bd5aaa8cd062ebf8e4528a4e537c950ecc02a314fbef3bc53044044b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7363686f6c61726c792f70726f7669646572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/scholarly/providers)[![GitHub Tests Action Status](https://camo.githubusercontent.com/c570c569b69c6d6fd8f150405ad29f59263660607910116b4b288cba6ae24a3c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d62736f667433312f7363686f6c61726c792d70726f7669646572732f63692e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/mbsoft31/scholarly-providers/actions)[![codecov](https://camo.githubusercontent.com/b71bdcb80c882dba610f8b12122377f35e9084d2d23f126f3c5bbd71bd292565/68747470733a2f2f636f6465636f762e696f2f67682f6d62736f667433312f7363686f6c61726c792d70726f7669646572732f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/mbsoft31/scholarly-providers)[![Total Downloads](https://camo.githubusercontent.com/ddcc4b3915c89848737c45d24fd89df9c880bbf87b8bf0b0492a70b1eec1433e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7363686f6c61726c792f70726f7669646572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/scholarly/providers)

Unified PHP SDK for scholarly data providers (OpenAlex, Semantic Scholar, Crossref) with a clean contracts layer, robust HTTP client with retries and caching, and a graph exporter powered by mbsoft/graph-core and mbsoft/graph-algorithms.

✨ Features
----------

[](#-features)

- 🔌 Provider adapters: OpenAlex, Semantic Scholar (S2), Crossref
- 🧩 Clean contracts: `Query`, `Paginator`, `ScholarlyDataSource`
- 🔁 Resilient HTTP: jittered backoff, retry-after handling, 4xx/5xx classification
- 🧠 Normalization utils: DOI, arXiv, PubMed, ORCID helpers
- 🗃️ Caching: PSR-16 and PSR-6 support via a simple `CacheLayer`
- 📈 Graph export: citation and collaboration graphs as mbsoft/graph `Graph`
- 🧪 Well-tested: Pest test suite, static analysis with PHPStan
- 🧰 Framework-friendly: Laravel service provider + facade

📋 Requirements
--------------

[](#-requirements)

- PHP 8.3+
- ext-json, ext-curl
- PSR-18 HTTP client and PSR-17 factories (or use Symfony HttpClient + Nyholm PSR-7)

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require scholarly/providers
```

Optional (Laravel): package discovery registers `Scholarly\Laravel\ScholarlyServiceProvider`. If you disable discovery, register it manually in `config/app.php`.

🚀 Quick Start
-------------

[](#-quick-start)

```
use Scholarly\Contracts\Query;
use Scholarly\Factory\AdapterFactory;

$factory  = AdapterFactory::make();
$openAlex = $factory->adapter('openalex');

// Search works
$results = $openAlex->searchWorks(Query::from(['q' => 'graph neural networks', 'limit' => 25]));
foreach ($results as $work) {
    // each $work is array
}

// Build a citation graph around a seed set
$graph = $factory
    ->graphExporter($openAlex)
    ->buildWorkCitationGraph(['openalex:W123'], Query::from(['limit' => 50]));

// Export using mbsoft/graph exporters (e.g., Cytoscape JSON)
// use Mbsoft\Graph\IO\CytoscapeJsonExporter;
// $json = (new CytoscapeJsonExporter())->export($graph);
```

PSR-first design: inject your own PSR-18 client, PSR-17 factories, PSR-16/PSR-6 cache, or PSR-3 logger via `AdapterFactory::make([...], $container)`.

🔍 Advanced Features
-------------------

[](#-advanced-features)

- Caching: wrap a PSR-16 or PSR-6 store with `CacheLayer` and pass to the exporter to reuse reference/citation lookups between runs.
- Retries &amp; backoff: the client honors `Retry-After` headers and applies jittered exponential backoff for transient errors.
- Batching &amp; pagination: iterate `Paginator` instances (`searchWorks`, `listReferences`, `listCitations`) or use `batchWorksByIds`.
- Identifier helpers: `getWorkByDoi`, `getWorkByArxiv`, `getWorkByPubmed`, `getAuthorByOrcid` normalize inputs and handle not-found paths.

🧱 Architecture
--------------

[](#-architecture)

- `src/Contracts`: `Query` value object, `Paginator`, `ScholarlyDataSource` contract
- `src/Core`: HTTP client, backoff, cache layer, identity normalization
- `src/Adapters`: OpenAlex, S2, Crossref implementations and paginators
- `src/Exporter`: Graph exporter building mbsoft/graph `Graph` instances
- `src/Factory`: Adapter factory, configuration objects, Laravel bindings
- `src/Laravel`: Service provider and facade

See `docs/` for architecture notes, provider specifics, and Laravel usage.

⚙️ Configuration
----------------

[](#️-configuration)

Environment variables (or publish `config/scholarly.php` in Laravel):

- `SCHOLARLY_DEFAULT_ADAPTER` (e.g., `openalex`)
- `SCHOLARLY_CACHE_STORE` (Laravel) or provide `CacheInterface`/`CacheItemPoolInterface`
- `SCHOLARLY_HTTP_TIMEOUT` (seconds)
- Provider settings: `OPENALEX_MAILTO`, `S2_API_KEY`, `CROSSREF_MAILTO`

Graph exporter query flags:

- `work_ids` (seed set), `limit` (page sizes), `max_works` (author graph cap), `min_collaborations` (edge threshold)

🧰 Laravel Usage
---------------

[](#-laravel-usage)

```
use Scholarly\Laravel\Facades\Scholarly;

// Resolve the default provider (configured via scholarly.default)
$adapter = Scholarly::adapter();

// Export graphs
$exporter = Scholarly::graphExporter();
$graph    = $exporter->buildWorkCitationGraph(['openalex:W1'], Query::from(['limit' => 50]));
```

Publish config if needed:

```
php artisan vendor:publish --tag=scholarly-config
```

🧪 Testing
---------

[](#-testing)

Run the test suite:

```
composer test
```

With coverage:

```
composer test-coverage
```

Static analysis and coding style:

```
composer stan
composer cs-check
```

Fixtures for provider responses live under `tests/Fixtures/`. Guard any live API tests with `SCHOLARLY_LIVE_TESTS=1`.

📚 Documentation
---------------

[](#-documentation)

- Start here: `docs/index.md`
- Quick start guide: `docs/getting-started.md`
- Contracts reference: `docs/contracts.md`
- Graphs &amp; algorithms: `docs/graph.md`
- Adapters: `docs/adapters/openalex.md`, `docs/adapters/s2.md`, `docs/adapters/crossref.md`
- Extending: `docs/extending.md`

Hosted docs (GitHub Pages):

🎯 Use Cases
-----------

[](#-use-cases)

- Research discovery and enrichment workflows
- Building literature citation graphs for analysis/visualization
- Author collaboration network analysis
- Data pipelines integrating multiple scholarly sources via one API

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please open an issue or PR.

1. Fork the repository
2. Create your feature branch (`git checkout -b feat/awesome`)
3. Ensure quality gates pass (`composer quality`)
4. Push and open a Pull Request

📝 License
---------

[](#-license)

This library is open-sourced software licensed under the MIT license.

🔗 See Also
----------

[](#-see-also)

- [mbsoft/graph-core](https://github.com/mbsoft31/graph-core)
- [mbsoft/graph-algorithms](https://github.com/mbsoft31/graph-algorithms)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance63

Regular maintenance activity

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.5% 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 ~0 days

Total

2

Last Release

228d ago

PHP version history (2 changes)1.0.0PHP ^8.2

v1.0.1PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/288f14daea877ea6b5b49d25bf1647f75eab2870b3e143e2a35b17a0666f1bd8?d=identicon)[mbsoft](/maintainers/mbsoft)

---

Top Contributors

[![abiatarprado](https://avatars.githubusercontent.com/u/53842349?v=4)](https://github.com/abiatarprado "abiatarprado (17 commits)")[![mbsoft31](https://avatars.githubusercontent.com/u/14237661?v=4)](https://github.com/mbsoft31 "mbsoft31 (2 commits)")

---

Tags

laravelsdkgraphcitationcrossrefopenalexscholarlysemantic scholar

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/scholarly-providers/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[windwalker/framework

The next generation PHP framework.

25639.1k1](/packages/windwalker-framework)

PHPackages © 2026

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