PHPackages                             maizied/roast-api - 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. maizied/roast-api

ActiveLibrary[API Development](/categories/api)

maizied/roast-api
=================

A PHP client for RaaS — Roast as a Service. CDN-served static JSON API for developer roasts.

v1.5.0(4mo ago)20MITHTMLPHP &gt;=7.4CI passing

Since Feb 17Pushed 3w agoCompare

[ Source](https://github.com/Maijied/roast-as-a-service)[ Packagist](https://packagist.org/packages/maizied/roast-api)[ Docs](https://maijied.github.io/roast-as-a-service/)[ RSS](/packages/maizied-roast-api/feed)WikiDiscussions main Synced today

READMEChangelog (7)DependenciesVersions (4)Used By (0)

🥵 Roast as a Service (RaaS)
===========================

[](#-roast-as-a-service-raas)

 [![RaaS Logo](https://camo.githubusercontent.com/d9ee33d15f45c752c2696f5f223b48518ceecd2eb7465927a5d089c41c5d3b57/68747470733a2f2f6d61696a6965642e6769746875622e696f2f726f6173742d61732d612d736572766963652f6173736574732f6c6f676f2e706e67)](https://camo.githubusercontent.com/d9ee33d15f45c752c2696f5f223b48518ceecd2eb7465927a5d089c41c5d3b57/68747470733a2f2f6d61696a6965642e6769746875622e696f2f726f6173742d61732d612d736572766963652f6173736574732f6c6f676f2e706e67)

 [![Visitor Count](https://camo.githubusercontent.com/1c343169fa2ab00bd864678d3122bf5a83b69008ed6e212be3ea06ab4e22b1d8/68747470733a2f2f686974732e73682f6d61696a6965642e6769746875622e696f2f726f6173742d61732d612d736572766963652e7376673f766965773d746f6461792d746f74616c267374796c653d666c61742d737175617265266c6162656c3d76697369746f727326636f6c6f723d656334383939266c6162656c436f6c6f723d303230363137)](https://camo.githubusercontent.com/1c343169fa2ab00bd864678d3122bf5a83b69008ed6e212be3ea06ab4e22b1d8/68747470733a2f2f686974732e73682f6d61696a6965642e6769746875622e696f2f726f6173742d61732d612d736572766963652e7376673f766965773d746f6461792d746f74616c267374796c653d666c61742d737175617265266c6162656c3d76697369746f727326636f6c6f723d656334383939266c6162656c436f6c6f723d303230363137) [![npm version](https://camo.githubusercontent.com/ac992851061e95acc9aaad8a24077b74f957c0763b4486446ee579dfaade6f40/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f726f6173742d6170693f7374796c653d666c61742d73717561726526636f6c6f723d663937333136266c6162656c436f6c6f723d303230363137)](https://www.npmjs.com/package/roast-api) [![npm downloads](https://camo.githubusercontent.com/0f9f6e41a9cd67c3ea24fdf1b36701157d0c71783a58d9df382e5e6d424c6ecf/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f726f6173742d6170693f7374796c653d666c61742d73717561726526636f6c6f723d656334383939266c6162656c436f6c6f723d303230363137)](https://www.npmjs.com/package/roast-api) [![PyPI version](https://camo.githubusercontent.com/b38fec8d6a1576885ad9976e598dbfedd50411cda9d8848869a7afc1d4d5ec5b/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f726f6173742d6170692e7376673f7374796c653d666c61742d73717561726526636f6c6f723d336238326636266c6162656c436f6c6f723d303230363137)](https://pypi.org/project/roast-api/) [![Packagist version](https://camo.githubusercontent.com/9ebd0101da56b9483eb130774dde20d37947f243ad458abdc0e77453907a2509/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61697a6965642f726f6173742d6170693f7374796c653d666c61742d73717561726526636f6c6f723d313062393831266c6162656c436f6c6f723d303230363137)](https://packagist.org/packages/maizied/roast-api) [![RaaS CI/CD Pipeline](https://github.com/Maijied/roast-as-a-service/actions/workflows/ci.yml/badge.svg)](https://github.com/Maijied/roast-as-a-service/actions/workflows/ci.yml)

 [![Deploy to GitHub Pages](https://camo.githubusercontent.com/1819a4a46a3cb02979366239cf88c6c7f06a2b3732d4bef8292ab704bf48db5f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4465706c6f79253230746f2d47697448756225323050616765732d626c75653f7374796c653d666c61742d737175617265266c6f676f3d676974687562)](https://maijied.github.io/roast-as-a-service/)

---

[![RepoRanker](https://camo.githubusercontent.com/943eab312775a7d94b7a119de297972b08e644c1668126eefe0c33e0d6cb114c/68747470733a2f2f7265706f72616e6b65722e636f6d2f62616467652f4d61696a6965642f726f6173742d61732d612d73657276696365)](https://reporanker.com/repos/Maijied/roast-as-a-service)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#)

Random developer roasts, delivered via a blazing‑fast static API on GitHub Pages. Plug it into your apps, bots, terminals, or CI logs when “nice error messages” just aren’t enough.

> **Part of the [Lorapok Ecosystem](https://github.com/Maijied/lorapok)** — Building the future of AI-driven developer tools. 🐛

---

🚀 What is RaaS?
---------------

[](#-what-is-raas)

Roast as a Service is a GitHub‑hosted, CDN‑backed JSON API that returns developer‑themed roasts in English and Bangla.
It’s completely static (no servers), but feels dynamic thanks to a smart client SDK that shards, caches, and randomly selects roasts on the fly.

Use it when you want your:

- CLI tools to roast the user on failure.
- CI pipeline to roast you when tests fail.
- Discord/Slack bots to respond with spicy dev insults.
- Portfolio or landing page to show random roasts on each visit.

---

🌐 Live Service
--------------

[](#-live-service)

- **Website:**
- **API Base Path:**

---

⚡ Quick Start
-------------

[](#-quick-start)

### 1. Install via npm

[](#1-install-via-npm)

```
npm install roast-api
# or
npm install @maizied/roast-as-a-service
```

```
const RaaS = require('roast-api');

RaaS.getRandomRoast({ lang: 'en' })
  .then(r => console.log(r.text));
```

### 2. Script Include (Browser)

[](#2-script-include-browser)

Load the client SDK directly in your browser:

```

  // Fetch a random Bangla roast with intensity 2
  RaaS.getRandomRoast({ lang: 'bn', intensity: 2 })
    .then(r => console.log(r.text));

```

### 3. Install via Composer (PHP)

[](#3-install-via-composer-php)

```
composer require maizied/roast-api
```

```
use Maizied\RoastApi\RaaS;

$roast = RaaS::getRandomRoast(['lang' => 'en']);
echo $roast['text'];
```

### 4. Install via pip (Python)

[](#4-install-via-pip-python)

```
pip install roast-api
```

```
from roast_api import get_random_roast

roast = get_random_roast(lang='en')
print(roast['text'])
```

### 5. Direct Fetch

[](#5-direct-fetch)

Or just fetch the JSON files directly:

```
fetch('https://maijied.github.io/roast-as-a-service/api/en/roasts-en-1.json')
  .then(res => res.json())
  .then(data => {
    const list = data.roasts;
    const pick = list[Math.floor(Math.random() * list.length)];
    console.log(pick.text);
  });
```

---

🛠 How it works
--------------

[](#-how-it-works)

RaaS exposes sharded JSON datasets over GitHub Pages, then a tiny client SDK picks, filters, and caches roasts in the browser, giving you an API‑like experience with pure static hosting.

- **Static API**: Roasts are stored in language‑specific shards (`en`, `bn`) and served as JSON over GitHub Pages’ global CDN for low TTFB.
- **Smart client**: The bundled client fetches a small shard, caches it, and returns random roasts with optional intensity and length filters.
- **Zero ops**: No servers, no cold starts, no scaling issues. Push to main, let Pages deploy and cache everything at the edge.

---

📦 API Overview
--------------

[](#-api-overview)

This is a **static** API: data comes from versioned JSON files served over CDN, and a lightweight JS client handles randomness, filtering and caching in the browser.

### Endpoints (static JSON)

[](#endpoints-static-json)

- **Manifest:**
    `GET https://maijied.github.io/roast-as-a-service/api/manifest.json`
- **English Shard #1:**
    `GET https://maijied.github.io/roast-as-a-service/api/en/roasts-en-1.json`
- **Bangla Shard #1:**
    `GET https://maijied.github.io/roast-as-a-service/api/bn/roasts-bn-1.json`

### Example Response Structure

[](#example-response-structure)

Each shard looks like:

```
{
  "language": "en",
  "shard": 1,
  "total_shards": 5,
  "count": 300,
  "tags": ["dev", "general"],
  "roasts": [
    {
      "id": "en-1-1",
      "text": "Your codebase looks like it was written during a live outage.",
      "intensity": 2,
      "length": 61
    }
  ]
}
```

### Usage Example (curl + jq)

[](#usage-example-curl--jq)

```
curl -s https://maijied.github.io/roast-as-a-service/api/en/roasts-en-1.json \
  | jq '.roasts[0].text'
```

---

🧬 Why this architecture is “state of the art”
---------------------------------------------

[](#-why-this-architecture-is-state-of-the-art)

Roast as a Service is intentionally built as a **static API** on top of GitHub Pages and a CDN, instead of a traditional backend. For this use case (serving pre‑made content), this gives you the same “API experience” with less cost, less complexity, and better global latency.

Key points:

- **Static JSON over CDN**
    All responses are just versioned JSON files served by GitHub Pages’ global edge network, which is highly cache‑friendly and extremely fast for read‑heavy traffic.
- **Zero backend, zero cold starts**
    There is no application server to boot, scale, or warm up. Every request hits static content that can be served from edge cache with minimal TTFB.
- **Sharded data layout**
    Roasts are split into language‑specific shards (e.g. `en/roasts-en-1.json`) so each response stays small and cacheable even if the total dataset becomes large.
- **Client‑side selection and filtering**
    A tiny SDK handles randomness, intensity filters, and length limits in the client, so the “API” stays read‑only and ultra fast instead of computing on every request.
- **Edge‑friendly cache behavior**
    Because the content is static and not personalized, CDN nodes can cache responses aggressively without worrying about user‑specific data. That’s exactly what CDNs are optimized for.
- **Version‑controlled API**
    All JSON lives in Git; you can roll back, branch, and review changes like any other codebase while GitHub Pages redeploys and re‑caches automatically.

This combination (static JSON + sharding + client‑side logic + CDN caching) is effectively the “fast path” that many dynamic APIs end up approximating with layers of caching—here it’s the default.

⚡ Performance &amp; Benchmarks
------------------------------

[](#-performance--benchmarks)

RaaS is built for extreme speed and low overhead. By sharding data and relying on CDN edge caching + local browser caching, it achieves massive throughput.

**Latest Benchmark Results:**

- **Requests/sec**: ~2,000 (Tested with 5,000 total requests)
- **Success Rate**: 100% (Zero failures under high concurrency)
- **Avg Latency**: ~58ms
- **P95 Latency**: ~159ms
- **Cache Efficiency**: 90%+ (Manifest and shard reuse)

Tip

This "Static API" approach beats the latency of traditional dynamic APIs by removing backend processing, cold starts, and database queries from the request path.

---

🐛 More from Lorapok
-------------------

[](#-more-from-lorapok)

RaaS is a proud member of the **Lorapok** family. Check out our other tools:

- **[Lorapok CLI](https://github.com/Maijied/lorapok):** The intelligent AI agent framework for developers.
- **[Lorapok Media Player](https://github.com/Maijied/Lorapok_Media_Player):** A modern, feature-rich media player built for power users.

---

👤 Author
--------

[](#-author)

**Maizied**
📧
🔗 [GitHub](https://github.com/Maijied) · [npm](https://www.npmjs.com/~maizied)

---

📄 License
---------

[](#-license)

MIT © Maizied

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance86

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

Every ~0 days

Total

3

Last Release

136d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/085d96d3f88205736e02f8c7ba920c1a838725ae1128c4feaf2caece92e1441d?d=identicon)[maizied](/maintainers/maizied)

---

Top Contributors

[![Maijied](https://avatars.githubusercontent.com/u/11429916?v=4)](https://github.com/Maijied "Maijied (37 commits)")

---

Tags

apiraasrestapiserviceapidevelopercdnfunhumorroast

### Embed Badge

![Health badge](/badges/maizied-roast-api/health.svg)

```
[![Health](https://phpackages.com/badges/maizied-roast-api/health.svg)](https://phpackages.com/packages/maizied-roast-api)
```

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22879.8k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

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