head
ArrayReturns the first N items of an array. Default is 10 when no argument is given. Equivalent to SQL LIMIT.
Syntax
head:n?noptionalNumber of items to keep from the start. Defaults to 10.Use cases
| Use case | Description | URL | |
|---|---|---|---|
| Top 5 starred repos | Get only the five most-starred repos — a quick leaderboard. | https://httpip.es/api/pipe/fetch:https://api.github.com/users/octocat/repos|rsort:stargazers_count|head:5|pick:name,stargazers_count | |
| First 10 posts | Page 1 of a blog post list without any query parameters. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/posts|head:10|pick:id,title | |
| Preview an API response | Peek at just the first 3 records before deciding what fields to pick. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/users|head:3 | |
| Top 3 languages used | After grouping repos by language, show only the first 3 groups. | https://httpip.es/api/pipe/fetch:https://api.github.com/users/octocat/repos|pluck:language|distinct|sort|head:3 | |
| Single best result | Return only the top-ranked item after sorting — like a SQL LIMIT 1. | https://httpip.es/api/pipe/fetch:https://api.github.com/users/octocat/repos|rsort:stargazers_count|head:1|pick:name,stargazers_count,html_url |