PHPackages                             zhylon/megapi-client - 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. zhylon/megapi-client

ActiveLibrary[API Development](/categories/api)

zhylon/megapi-client
====================

This package can be used to interact with the MegAPI.

1.0.0(1y ago)0101MITPHPPHP &gt;=8.2

Since Mar 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Zhylon/megapi-client)[ Packagist](https://packagist.org/packages/zhylon/megapi-client)[ Docs](https://github.com/Zhylon/megapi-client)[ RSS](/packages/zhylon-megapi-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (1)

[![Zhylon MegAPI Client](https://camo.githubusercontent.com/cc504b6bdf1f3a7f40ea32b9d3bfa5076e4e96b6949ccfa1f5a8c03e55139f9b/68747470733a2f2f736f6369616c6966792e6769742e63692f7a68796c6f6e2f6d65676170692d636c69656e742f696d6167653f6465736372697074696f6e3d3126666f6e743d52616c65776179266973737565733d31266c616e67756167653d31266f776e65723d31267061747465726e3d436861726c696525323042726f776e2670756c6c733d31267374617267617a6572733d31267468656d653d4c69676874)](https://socialify.git.ci/zhylon/megapi-client?description=1&font=Raleway&issues=1&language=1&owner=1&pattern=Charlie%20Brown&pulls=1&stargazers=1&theme=Light)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5965427b79427dc16243751b903a7b76847b4acb3f1dcfc5a78078f2501f743b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a68796c6f6e2f6d65676170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zhylon/megapi-client)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/d9f574317c0233d339736d4fb4a311a0569251df3bc50f02036743399ef8af52/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a68796c6f6e2f6d65676170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zhylon/megapi-client)[![Support me on Patreon](https://camo.githubusercontent.com/cef3268299ac4e91c241041bc589061c18d2c61f9e8393f33907c2fb23fe11be/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e742e7376673f75726c3d6874747073253341253246253246736869656c6473696f2d70617472656f6e2e76657263656c2e617070253246617069253346757365726e616d65253344546f62796d617868616d25323674797065253344706174726f6e73267374796c653d666c6174)](https://patreon.com/Tobymaxham)

The **Zhylon MegAPI Client** is a Laravel wrapper for [MegAPI](https://megapi.de) API, a platform that consolidates multiple APIs under a **single API key**.

Many developers struggle with managing multiple external APIs, each with its own authentication, documentation, and structure. **MegAPI solves this problem** by providing a unified interface where you only need **one API key** to access multiple services.

**Why use MegAPI?**

- **One API key** for all services
- **Centralized API interface** with a consistent structure
- **Seamless Laravel integration**
- **Flexible extension**: Register and use custom endpoints
- **Less authentication overhead** for multiple APIs

You are free to use this package, but please note that you need an active account on [MegAPI](https://megapi.de) to use the service.

The MegAPI is a service by [Zhylon.net](https://id.zhylon.net/). It includes a lot of API Endpoints to other services. It allows you to call all those services with just one API key.

**This packages does not provide any endpoints, it's just a wrapper for the API**.

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

[](#installation)

You can install the package via Composer:

```
composer require zhylon/megapi-client
```

Configuration
-------------

[](#configuration)

You can publish the config file with:

```
php artisan vendor:publish --provider="Zhylon\MegapiClient\MegApiServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [
    'megapi' => [
        'key'      => env('MEGAPI_KEY'), // this is the key
        'endpoint' => env('MEGAPI_ENDPOINT', 'https://megapi.de/api'), // this is the endpoint
    ],
];
```

Usage
-----

[](#usage)

To register a new endpoint to the MegAPI, you can use the following code:

```
