PHPackages                             ustal/rapidapi-library - 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. ustal/rapidapi-library

ActiveLibrary[API Development](/categories/api)

ustal/rapidapi-library
======================

Bundle to work with the API. Validation and parsing according to the metadata

1.2.2(6y ago)0792MITPHPPHP &gt;7.0.0CI failing

Since May 22Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ustal/RapidAPI-library)[ Packagist](https://packagist.org/packages/ustal/rapidapi-library)[ Docs](https://github.com/ustal/RapidAPI-library)[ RSS](/packages/ustal-rapidapi-library/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (2)Versions (16)Used By (2)

[![Build status](https://camo.githubusercontent.com/3fdacc758064e824ac69114005e58c7f14a8f4f5257d5f0646388d2acffc9bb8/68747470733a2f2f7472617669732d63692e6f72672f757374616c2f52617069644150492d6c6962726172792e7376673f6272616e63683d312e322e30)](https://travis-ci.org/ustal/RapidAPI-library)[![Latest Stable Version](https://camo.githubusercontent.com/88120e789394faa7b6ef3d63e8c46c54f7aaed127ddc52d55599c1a0527391bc/68747470733a2f2f706f7365722e707567782e6f72672f757374616c2f72617069646170692d6c6962726172792f762f737461626c65)](https://packagist.org/packages/ustal/rapidapi-library)[![Total Downloads](https://camo.githubusercontent.com/43325109bffd8db90b60157821010eeb51f92029f089aa77460aca09dfeef2c9/68747470733a2f2f706f7365722e707567782e6f72672f757374616c2f72617069646170692d6c6962726172792f646f776e6c6f616473)](https://packagist.org/packages/ustal/rapidapi-library)[![Latest Unstable Version](https://camo.githubusercontent.com/d7e737c3cf9d9215c55b8c18166f253e6687a0aac43d010c988f91458ecd7d3c/68747470733a2f2f706f7365722e707567782e6f72672f757374616c2f72617069646170692d6c6962726172792f762f756e737461626c65)](https://packagist.org/packages/ustal/rapidapi-library)[![License](https://camo.githubusercontent.com/179167419541d30f65c8d7f6b0d3b50f8031fd26e562d4d3c60bb0d446959783/68747470733a2f2f706f7365722e707567782e6f72672f757374616c2f72617069646170692d6c6962726172792f6c6963656e7365)](https://packagist.org/packages/ustal/rapidapi-library)[![codecov](https://camo.githubusercontent.com/a3327a2ca72e631fd950ce8f134a631e232361b3d893aab328a86225915ed524/68747470733a2f2f636f6465636f762e696f2f67682f757374616c2f52617069644150492d6c6962726172792f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/ustal/RapidAPI-library/branch/master)

#### Manual

[](#manual)

Вызываем менеджер `$manager = $this->get('manager');`

Передаем название блока (т.е. какой именно блок будем юзать). `$manager->setBlockName($blockName);`

Получаем все валидные данные (согласно метадате) `$validData = $manager->getValidData();`

Парсим урл из метадаты и переданный. Заменяем {someVar} на значение из $validData. Если в метадате только куски, например `/someAction/`. Смотря как делали метадату и может для каждоого Endpoint разные ссылки. `$url = $manager->createFullUrl($validData, $url);`

Создаем `headers`. Обязательно удаляем из `$validData` переменные, которые передавать не надо (использовались для генерации хедера. Для этого нужна ссылка `function createHeaders(&$data)`. Эту функцию описываем в пакете. `$headers = $manager->createHeaders($validData);`

Получаем переменные. Иногда бывает что и для POST запросов надо отправить кучу в URL. Поэтому, используя, `urlParam` можно разделить параметры на две части. `$urlParams = $manager->getUrlParams();``$bodyParams = $manager->getBodyParams();`

$result = $manager-&gt;send($url, $urlParams, $bodyParams, $headers);

### Custom tags use only in assoc array with `"custom"` key variable of block and block's arguments.

[](#custom-tags-use-only-in-assoc-array-with-custom-key-variable-of-block-and-blocks-arguments)

#### Blocks

[](#blocks)

TagNameTypeDescriptionmethod\*StringOne of `PUT`, `POST`, `GET`, `DELETE`, `PATCH` etcurl\*StringSecond part of endpoint `/endpointName/action` or whole endpoint `http://example/com/api/v1/endpointName/action` can contain {var}, which will be replaced args by name (in case) or vendorName. Args to replace must be without `wrapName` tagtypeString`multipart` or `json`. Default: jsonsnakeCaseBooleanTrue if you want to change all name from `exampleVendorName` to `example_vendor_name`. Priority is given to same tag of args. Default: falseSpecific tags (depends on dataType of argument)
-----------------------------------------------

[](#specific-tags-depends-on-datatype-of-argument)

#### Map

[](#map)

TagNameTypeDescriptiondivideBooleanUse with Map. Divide string from marketPlace to List.toFloatBooleanConvert `value` or `list of values` into Float. If u divided Map and vendor wants get float values not stringslengthNumberLength of float or string param. Set 1 to convert 123.1111 to 123.1 or "123.1111" to "123.1"#### Map (temporary not available)

[](#map-temporary-not-available)

| lat | String | If divide is true, change list info assocc Array with key = `lat` value | lng | String | If divide is true, change list info assocc Array with key = `lng` value

#### DatePicker

[](#datepicker)

TagNameTypeDescriptiondateTime.fromFormatArrayCreate date from one of format. Like \[`Y-m-d\TH:i:s\Z`, `Y-m-d`, `timestamp`\].dateTime.toFormatStringConvert data to current format. Like `Y-m-d\TH:i:s\Z`#### Boolean

[](#boolean)

TagNameTypeDescriptiontoIntBooleanConvert true/false into integer 1/0toStringBooleanBoolean convert `true` into `"true"` and `false` into `"false"` Useful if need send var in url.#### Number

[](#number)

#### String

[](#string)

#### Select

[](#select)

#### File

[](#file)

TagNameTypeDescriptionjsonParseBooleanпарсит файл и вставляет в собранный JSONbase64encodeBooleanзакодировать содержимое файла в base64#### Array

[](#array)

TagNameTypeDescriptionkeyValueArrayUse to create key=&gt;value from array with params key and value.keyValue.keyStringWork only with Arrays. Create `key->value` array from multi-dimensional array. Set one of the structure parameters as the key. Do the same with the value.keyValue.valueStringWork only with Arrays. Create `key->value` array from multi-dimensional array. Set one of the structure parameters as the key. Do the same with the value.#### List

[](#list)

TagNameTypeDescriptiontoArrayBooleanConvert string into List (use `slug` to implode)toStringBooleanConvert List into String with delimetr `slug`. Default `slug` = `,`slugStringImplode or explode arrays/strings by this `slug`. Default `slug` = `,`toFloatBooleanConvert `list of values` into FloatfloatLength?NumberLength of float param. Set 1 to convert 123.1111 to 123.1#### All tags (work with all dataTypes)

[](#all-tags-work-with-all-datatypes)

TagNameTypeDescriptionwrapNameStringиспользуется для вложенности параметров. Создания дерева вложенности переменных. forum.post.comment создаст массивы forum:{post:{comment:{name}}} где name имя переменной, для которой указан wrapName. Соотв не забывать что последнее всегда будет имя переменной. Не стоит дублировать name: commentContent, wrapName: forum.post.comment.commentContent. Будет: forum:{post:{comment:{commentContetn:{commentContent:{value}}}}}vendorNameStringимя аргумента, которое хочет получить вендор. Если не указано, вендор получит имя аргумента в snake case.urlParamBooleanпараметр используется в ссылке. В ссылке никаких {var=value&amp;foo=bar} не надо. Просто эта переменная (по name или vendorName) будет добавлена со своим значением к ссылке. Использовать с GET параметром не надо. Параметры автоматически будут переданы в urlsnakeCaseBooleantrue/false. Если стоит true, даже если у блока стоит false, переменная будет преобразована в camel\_casecomplexArrayсложный параметр. Когда значение одного поля является ключ, другого - значение. Например когда хотят получить {type: email, value: {value}}. Соотв будет только одно поле email и его значение {value}. Но добавится параметр complex: truecomplex.keyStringимя для ключа. В примере выше это будет "type". Используется когда complex: truecomplex.valueStringимя для значения. В примере выше это будет "value". Используется когда complex: true#### Пример комплекса

[](#пример-комплекса)

```
{"contacts":
    [
    "type": "facebook",
    "value": {value}
    ],
    [
    "type": "twitter",
    "value": {value}
    ]
}

```

Первый пример (мультипарт) POST [https://your-domain-name.example.com/forum/1/category/2/newPost?insertPostSafeAndWhatEver=1&amp;draft=true](https://your-domain-name.example.com/forum/1/category/2/newPost?insertPostSafeAndWhatEver=1&draft=true)И ожидает получить title, content, attachment

```
{
  "name": "createNewPost",
  "description": "Create new post",
  "custom": {
    "method": "POST",
    "type": "multipart", //default json
    "url": "https://{domain}.example.com/forum/{forumId}/category/{category_id}/newPost"
  },
  "args": [
    {
      "name": "domain",
      "type": "String",
      "info": "",
      "required": true
    },
    {
      "name": "forumId",
      "type": "String",
      "info": "",
      "required": true,
      "custom": {
        "vendorName": "forumId" // always use vendorName or snake style of "name". Repace forumId, not forum_id
      }
    },
    {
      "name": "categoryId", // transform to category_id, and replace it in url
      "type": "String",
      "info": "",
      "required": true
    },
    {
      "name": "insertSafe",
      "type": "Boolean",
      "info": "Insert post safe and what ever bla-bla-bla",
      "required": false,
      "custom": {
        "vendorName": "insertPostSafeAndWhatEver", //if not set, param name will be insert_safe (snake case)
        "toInt": true, //default false
        "urlParam": true // default false
      }
    },
    {
      "name": "draft",
      "type": "Boolean",
      "info": "",
      "required": true,
      "custom": {
        "urlParam": true
      }
    },
    {
      "name": "title",
      ....
    },
    {
      "name": "content"
    },
    {
      "name": "attachment",
      "type": "File",
      "info": "",
      "required": false
    }
  ],
  "callbacks": [
    {
      "name": "error",
      "info": "Error"
    },
    {
      "name": "success",
      "info": "Success"
    }
  ]
}

```

Второй пример (base64) POST [https://your-domain-name.example.com/forum/1/category/2/newPost?insertPostSafeAndWhatEver=1&amp;draft=true](https://your-domain-name.example.com/forum/1/category/2/newPost?insertPostSafeAndWhatEver=1&draft=true)И ожидает получить title, content, attachment

```
{
  "name": "createNewPost",
  "description": "Create new post",
  "custom": {
    "method": "POST",
    "url": "https://{domain}.example.com/forum/{forumId}/category/{categoryId}/newPost"
  },
  "args": [
    {
      "name": "domain",
      "type": "String",
      "info": "",
      "required": true
    },
    {
      "name": "forumId",
      "type": "String",
      "info": "",
      "required": true,
      "custom": {
        "vendorName": "forumId"
      }
    },
    {
      "name": "categoryId",
      "type": "String",
      "info": "",
      "required": true,
      "custom": {
        "vendorName": "categoryId"
      }
    },
    {
      "name": "insertSafe",
      "type": "Boolean",
      "info": "Insert post safe and what ever bla-bla-bla",
      "required": false,
      "custom": {
        "vendorName": "insertPostSafeAndWhatEver",
        "toInt": true,
        "urlParam": true
      }
    },
    {
      "name": "draft",
      "type": "Boolean",
      "info": "",
      "required": true,
      "custom": {
        "urlParam": true
      }
    },
    {
      "name": "title",
      ....
    },
    {
      "name": "content"
    },
    {
      "name": "attachment",
      "type": "File",
      "info": "",
      "required": false,
      "custom": {
        "base64encode": true
      }
    }
  ],
  "callbacks": [
    {
      "name": "error",
      "info": "Error"
    },
    {
      "name": "success",
      "info": "Success"
    }
  ]
}

```

Третий пример POST И ожидает получить JSON такого вида

```
{
  "post": {
    "title": "Post title",
    "content": "Post content",
    "attachment": "base64(image)"
    "user": {
      "name": "John Doe",
      "contacts": [
        {"typeContact": "email", "valueContact": "john@example.com"},
        {"typeContact": "twitter", "valueContact": "john111"}
      ]
    },
    "voting": {
      "question": "Be or not to be?",
      "answers": [
        "yes",
        "no",
        "dont know"
      ]
    },
    "other": {Object}
  }
}

```

```
{
  "name": "createNewPost",
  "description": "Create new post",
  "custom": {
    "method": "POST",
    "url": "https://{domain}.example.com/forum/{forum_id}/category/{category_id}/newPost"
  }
  "args": [
    {
      "name": "domain",
      "type": "String",
      "info": "",
      "required": true
    },
    {
      "name": "forumId",
      "type": "String",
      "info": "",
      "required": true
    },
    {
      "name": "categoryId",
      "type": "String",
      "info": "",
      "required": true
    },
    {
      "name": "title",
      "type": "String",
      "info": "",
      "required": "",
      "custom": {
        "wrapName": "post"
      }
    },
    {
      "name": "content",
      "type": "String",
      "info": "",
      "required": "",
      "custom": {
        "wrapName": "post"
      }
    },
    {
      "name": "file",
      "type": "File",
      "info": "",
      "required": "",
      "custom": {
        "wrapName": "post",
        "vendorName": "attachment",
        "base64encode": true
      }
    },
    {
      "name": "userName",
      "type": "String",
      "info": "",
      "required": "",
      "custom": {
        "vendorName": "name",
        "wrapName": "post.user"
      }
    },
    {
      "name": "email",
      "type": "String",
      "info": "User contact email",
      "required": "",
      "custom": {
        "wrapName": "post.user.contacts",
        "complex": true,
        "keyName": "typeContact",
        "valueName": "valueContact"
      }
    },
    {
      "name": "twitter",
      "type": "String",
      "info": "User contact twitter",
      "required": "",
      "custom": {
        "wrapName": "post.user.contacts",
        "complex": true,
        "keyName": "typeContact",
        "valueName": "valueContact"
      }
    },
    {
      "name": "votingQuestion",
      "type": "String",
      "info": "",
      "required": "",
      "custom": {
        "vendorName": "question",
        "wrapName": "post.voting"
      }
    },
    {
      "name": "answers",
      "type": "Array",
      "info": "If send String comma separated it make array???",
      "required": "",
      "custom": {
        "wrapName": "post.voting"
      }
    },
    {
      "name": "other",
      "type": "File",
      "info": "Data in JSON format unknown structure or cannot be translate into metadata. Example: Unknown elements"
      "required": "",
      "custom": {
        "jsonParse": true
        "wrapName": "post"
      }
    }
  ],
  "callbacks": [
    {
      "name": "error",
      "info": "Error"
    },
    {
      "name": "success",
      "info": "Success"
    }
  ]
}

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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 ~80 days

Recently: every ~253 days

Total

14

Last Release

2236d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aab85b383915bbb7e0514577593a134969f210aa51759afc88075805e5bd97d7?d=identicon)[ustal](/maintainers/ustal)

---

Top Contributors

[![ustal](https://avatars.githubusercontent.com/u/11928397?v=4)](https://github.com/ustal "ustal (85 commits)")

---

Tags

apiRapidAPI

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ustal-rapidapi-library/health.svg)

```
[![Health](https://phpackages.com/badges/ustal-rapidapi-library/health.svg)](https://phpackages.com/packages/ustal-rapidapi-library)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[get-stream/stream-chat

A PHP client for Stream Chat (https://getstream.io/chat/)

301.8M2](/packages/get-stream-stream-chat)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)

PHPackages © 2026

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