tail
ArrayReturns the last N items of an array. Default is 10 when no argument is given. Useful for getting the most-recent records when an API returns oldest-first.
Syntax
tail:n?noptionalNumber of items to keep from the end. Defaults to 10.Use cases
| Use case | Description | URL | |
|---|---|---|---|
| Most recent 5 todos | Grab the last 5 todos from an oldest-first list without any extra sorting. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/todos|tail:5|pick:id,title,completed | |
| Last 10 posts | Get the tail of a post list where IDs increase with recency. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/posts|tail:10|pick:id,userId,title | |
| Lowest starred repos | Find repos with the fewest stars after sorting ascending by star count. | https://httpip.es/api/pipe/fetch:https://api.github.com/users/octocat/repos|sort:stargazers_count|tail:3|pick:name,stargazers_count | |
| Last 5 from literal array | Slice the tail of a known array for boundary-condition testing. | https://httpip.es/api/pipe/echo:[1,2,3,4,5,6,7,8,9,10]|tail:5 |