PHPackages                             mbsoft31/laravel-openalex - 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. mbsoft31/laravel-openalex

ActiveLibrary[API Development](/categories/api)

mbsoft31/laravel-openalex
=========================

A fluent, elegant, and modern wrapper for the OpenAlex API, built for Laravel.

v1.0.0(7mo ago)01MITPHPPHP ^8.4CI passing

Since Sep 21Pushed 7mo agoCompare

[ Source](https://github.com/mbsoft31/laravel-openalex)[ Packagist](https://packagist.org/packages/mbsoft31/laravel-openalex)[ Docs](https://github.com/mbsoft31/laravel-openalex)[ GitHub Sponsors](https://github.com/Mbsoft)[ RSS](/packages/mbsoft31-laravel-openalex/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (13)Versions (2)Used By (0)

**Laravel OpenAlex API Wrapper**
================================

[](#laravel-openalex-api-wrapper)

### A fluent, elegant, and modern wrapper for the OpenAlex API, built for Laravel.

[](#a-fluent-elegant-and-modern-wrapper-for-the-openalex-api-built-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/050d691a1d0a03c9c87c8e05b91ff50c9dc2da0cdbe3abbdf3b78fb08aee6621/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d62736f667433312f6c61726176656c2d6f70656e616c65782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mbsoft31/laravel-openalex)[![GitHub Tests Action Status](https://camo.githubusercontent.com/fa6098c8f18aff1ee1da44a24957fd929bb779eceefde0d8e83bc2c8787d0b09/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d62736f667433312f6c61726176656c2d6f70656e616c65782f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/mbsoft31/laravel-openalex/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4248eb5ca3a8c7f11e9252b52304a829ab27674770be7e4921e8ff2eaa4d25e1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d62736f667433312f6c61726176656c2d6f70656e616c65782f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/mbsoft31/laravel-openalex/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/6b39772eaa8fd8950b104c04d97fc783a835d65554719a78989c114e743098f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d62736f667433312f6c61726176656c2d6f70656e616c65782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mbsoft31/laravel-openalex)

**Installation**
----------------

[](#installation)

```
composer require mbsoft31/laravel-openalex
```

Next, publish the configuration file:

```
php artisan vendor:publish \--provider="Mbsoft\\OpenAlex\\OpenAlexServiceProvider" \--tag="config"
```

It is highly recommended to add your email to [config/openalex.php](config/openalex.php).

**Usage**
---------

[](#usage)

### **Basic Queries**

[](#basic-queries)

```
    use Mbsoft\\OpenAlex\\Facades\\OpenAlex;

    // Find a work by its OpenAlex ID
    $work = OpenAlex::works()->find('W2741809807');

    // Find an author by their ORCID
    $author = OpenAlex::authors()->findByOrcid('0000-0002-1825-0097');

    // Get recent, highly-cited works about AI from a specific institution
    $works = OpenAlex::works()
        ->whereInstitutionRor('042nb2s44') // MIT
        ->where('publication_year', '>2024')
        ->search('artificial intelligence')
        ->sortBy('cited_by_count')
        ->get();
```

### **Automatic Pagination**

[](#automatic-pagination)

The `paginate` method returns a standard Laravel `LengthAwarePaginator` instance.

```
$paginatedWorks = OpenAlex::works()
    ->whereHas('concepts.id', 'C15744967') // AI
    ->paginate(perPage: 50, page: 2);

echo "Total AI papers: " . $paginatedWorks->total();
```

### **Cursors for Large Datasets**

[](#cursors-for-large-datasets)

Use `cursor()` to iterate over a large result set without consuming much memory. It fetches pages on-demand in the background.

```
$allWorksFromJournal = OpenAlex::works()
    ->where('primary_location.source.id', 'S4306520188')
    ->cursor();

foreach ($allWorksFromJournal as $work) {
    // Process millions of records safely
}
```

### **Caching**

[](#caching)

Drastically improve performance by caching API responses.

```
// Cache for 10 minutes
$works = OpenAlex::works()->where('publication_year', 2025)->cacheFor(600)->get();

// Cache forever
$source = OpenAlex::sources()->find('S139121223')->cacheForever()->get();
```

### **DTO Utilities**

[](#dto-utilities)

The returned Data Transfer Objects are equipped with helpful methods.

```
$work = OpenAlex::works()->find('W2741809807');

// Get plain text abstract
$abstract = $work->getAbstract();

// Get BibTeX citation
$bibtex = $work->toBibTeX();
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance62

Regular maintenance activity

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

233d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

apilaravelsdkacademicresearchMbsoftlaravel-openalexopenalex

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mbsoft31-laravel-openalex/health.svg)

```
[![Health](https://phpackages.com/badges/mbsoft31-laravel-openalex/health.svg)](https://phpackages.com/packages/mbsoft31-laravel-openalex)
```

###  Alternatives

[missael-anda/laravel-whatsapp

A Whatsapp Business Cloud API wrapper for Laravel.

677.5k](/packages/missael-anda-laravel-whatsapp)

PHPackages © 2026

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