wrap
ObjectWraps any value inside an object with a named key. Useful for naming a scalar result (like count or sum) before returning it as a structured JSON response.
Syntax
wrap:key?keyoptionalKey name for the wrapper object. Defaults to "data".Use cases
| Use case | Description | URL | |
|---|---|---|---|
| Name a count result | Return a count as {"total": N} instead of a bare number. | https://httpip.es/api/pipe/fetch:https://api.github.com/users/octocat/repos|count|wrap:total | |
| Name a sum result | Label the total star count so the response is self-documenting. | https://httpip.es/api/pipe/fetch:https://api.github.com/users/octocat/repos|sum:stargazers_count|wrap:total_stars | |
| Wrap a filtered list | Nest an array inside a named key for structured API responses. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/todos|filter:completed,eq,false|wrap:pending | |
| Wrap a string value | Turn a plain string result into a labeled JSON object. | https://httpip.es/api/pipe/fetch:https://dog.ceo/api/breeds/image/random|get:message|wrap:imageUrl |