EzAPI is a Unity package for clean REST API calls. Configure endpoints and APIConfigs in the editor, then hit APIs via APIManager or APIClass with queuing, retries, error handling.
For more details about this asset from the Unity Asset Store, please visit: Click Here
This is a paid asset, but now you can download the “EzAPI” for FREE. Please note that this package is provided solely for learning purposes or to test the product before purchase, and not for commercial use.
EzAPI v2.1.0 (Latest version)
“If possible, please buy the package to support the developer”
Description
EzAPI is a Unity package that turns messy web requests into a clean, configurable API layer. Instead of scattering `UnityWebRequest` code and hard-coded URLs across your project, you define your endpoints once in an editor Settings window and access them via a type-safe `EndPoints` enum.
You configure base URLs, environments (dev/staging/prod) and behavior using `APIConfig` ScriptableObjects, then swap them per build without touching code. Each API call uses strongly-typed request and response classes that inherit from `RequestPayloadBase` and `RequestResponseBase`, keeping your payloads and results easy to read, debug, and extend.
At runtime, you call APIs through `APIManager` (singleton) or `APIClass<TRequest, TResponse>` (per-call object) to add headers, callbacks, and progress listeners. Under the hood EzAPI provides request queuing, configurable max concurrent requests, retries, and structured error codes (`-1` network, `-2` call/config error, others from backend), plus performance improvements by avoiding reflection in `APIClass`. The result is a robust, production-ready API system that lets you focus on gameplay and features instead of low-level networking details.
Technical details
Unity version support: Built for Unity 2020.3+
Core transport: Wraps UnityWebRequest with a higher-level API for typed requests and responses.
Type-safe endpoints: Endpoints are configured in an editor Settings asset and exposed as a generated EndPoints enum (no magic strings).
Config system:
APIConfig ScriptableObject for base URL, timeouts, retry counts, and default behavior.
Multiple APIConfig assets supported for dev/staging/production swaps.
Request/response models:
Request classes inherit from RequestPayloadBase.
Response classes inherit from RequestResponseBase (includes success, responseCode, failureMessage).
API access patterns:
APIManager.Instance.HitAPI<TRequest, TResponse>(EndPoints endpoint, TRequest payload, …).
APIClass<TRequest, TResponse> instances for per-call configuration (headers, listeners, etc.).
Request queuing & concurrency:
Built-in request queue with configurable max concurrent requests.
Additional requests are queued and processed automatically.
Retry & timeout handling:
Per-endpoint retry configuration via RequestClass + APIConfig defaults.
Timeouts configurable at the config/endpoint level.
Performance optimizations:
APIClass API hits avoid reflection to reduce GC and overhead.
Centralized logic minimizes duplicate UnityWebRequest setup code.
Error semantics:
responseCode == -1: network-level errors (no internet, DNS, etc.).
responseCode == -2: API call / configuration errors (missing endpoint, invalid setup).
Other codes: backend/server HTTP or logical errors.
Editor integration:
Settings window under Tools > EZAPI > Settings for endpoints and config selection.
Tools > EZAPI > Save regenerates the EndPoints enum and persists configuration.
Extensibility & internals:
RequestClass represents endpoint config and can be inspected programmatically.
RequestMediater is an internal static helper for sending requests and handling low-level responses (accessible but not recommended for regular gameplay code).




