httpip.es
Unix pipes over HTTP
Fetch any JSON API, then transform it with a chain of commands. Sort, filter, pick fields, export as CSV. The URL is the program.
$ curl -gL 'httpip.es/api/pipe/echo:[5,3,1,4,2]|sort|head:3'
[1,2,3]How it works
Commands are separated by |, arguments follow a :, multiple arguments are separated by ,.
/api/pipe/command:arg1,arg2|command|command:arg
───┬─── ────┬──── ───┬─── ───┬─── ─┬─
│ └ args │ │ └ arg
└ command │ └ command
└ command (no args)Quick start
# Sort an array
$ curl -gL 'httpip.es/api/pipe/echo:[3,1,2]|sort'
[1,2,3]
# Fetch a JSON API, pick fields, sort by stars
$ curl -gL 'httpip.es/api/pipe/fetch:https://api.github.com/users/octocat/repos|rsort:stargazers_count|head:3|pick:name,stargazers_count'
# POST with your own input data
$ curl -gL -X POST httpip.es/api/pipe \
-H 'Content-Type: application/json' \
-d '{"input":[5,3,1],"pipeline":"sort|reverse"}'
[5,3,1]Try it
Most starred repos
fetch:https://api.github.com/users/octocat/repos|rsort:stargazers_count|head:5|pick:name,stargazers_count
Repos grouped by language
fetch:https://api.github.com/users/octocat/repos|group:language
User contact list as CSV
fetch:https://jsonplaceholder.typicode.com/users|pick:name,email,phone|csv
Unique languages used
fetch:https://api.github.com/users/octocat/repos|pluck:language|distinct|sort
Incomplete todos — count
fetch:https://jsonplaceholder.typicode.com/todos|filter:completed,eq,false|count
Total stars across all repos
fetch:https://api.github.com/users/octocat/repos|sum:stargazers_count|wrap:total_stars
Repo names, one per line
fetch:https://api.github.com/users/octocat/repos|pluck:name|sort|lines
Format IP as plain text
fetch:https://ipapi.co/json|template:{{ip}} is in {{city}} ({{country_name}})|text
Commands
37Features
Output formats
End any pipeline with csv, tsv, lines, or text to change the response format. The Content-Type header is set automatically.
$ curl -gL '...|pick:name,stars|csv'
name,stars
Hello-World,2900Caching
Add ?cache=N (seconds, max 3600) to set Cache-Control headers. Cached at Vercel's CDN edge.
$ curl -gL '...?cache=300'
# Cache-Control:
# public, s-maxage=300,
# stale-while-revalidate=60POST endpoint
Send your own data as a JSON body to /api/pipe with input and pipeline.
{
"input": [{"n":"b"},
{"n":"a"}],
"pipeline": "sort:n"
}