2 unstable releases
0.2.0 | Jul 1, 2020 |
---|---|
0.1.0 | Jun 8, 2020 |
#427 in HTTP client
31KB
229 lines
curlall
Simple curl-like CLI tool to automatically page through APIs.
- Works with APIs that return pages of JSON objects (e.g. GitHub or Bitbucket APIs)
- Prints the results, one line for each JSON object; ideal for piping to
jq
Tested with GitHub and Bitbucket APIs. Other websites will have different ways to do paging, so let me know if it doesn't work for yours and we can add support.
Examples
Print all repository names on bitbucket.org/atlassian:
curlall https://api.bitbucket.org/2.0/repositories/atlassian | jq -r .full_name
Limit to first 100:
curlall --limit 100 https://api.bitbucket.org/2.0/repositories/atlassian | jq -r .full_name
Print all URLs for users who starred github.com/rust-lang/rust:
curlall --user 'username:token' https://api.github.com/repos/rust-lang/rust/stargazers | jq -r .login
Installation
- Install Rust: https://www.rust-lang.org/tools/install
- Install curlall:
cargo install curlall
Contributing
Pull requests, issues and comments welcome!
License
curlall is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details. Opening a pull requests is assumed to signal agreement with these licensing terms.
Dependencies
~8–12MB
~242K SLoC