Search1API
Integrations

CLI

Search the web, read pages and check trends from your terminal with the Search1API CLI.

s1 puts the whole API in your terminal — and, because it prints JSON on demand, in your shell scripts too.

Install

curl -fsSL https://cli.search1api.com/install.sh | bash

That installs a standalone binary; no Node.js required. If you would rather use npm:

npm install -g search1api-cli

Log in

s1 login

This opens a browser, and saves the key for you. On a headless box, use s1 login --no-browser, or set the key directly:

s1 config set-key YOUR_API_KEY
# or
export SEARCH1API_KEY=YOUR_API_KEY

s1 config show prints what it is currently using.

Commands

CommandWhat it does
s1 search "<query>"Search the web
s1 news "<query>"Search the news
s1 crawl <url>Read a page
s1 sitemap <url>List a site's links
s1 trending <github|hackernews>Trending topics
s1 balanceRemaining credits
s1 loginAuthorize in the browser
s1 config set-key | showManage configuration
s1 updateUpdate s1 in place

Examples

# Five results from Google
s1 search "rust async" -n 5 -s google

# Search, then crawl the top 3 results for their full text
s1 search "web framework" -c 3

# Today's news, from Hacker News
s1 news "tech layoffs" -s hackernews -t day

# Machine-readable output, straight into jq
s1 search "test" --json | jq '.results[0].title'

The --json flag is what makes s1 scriptable: pipe it into jq, feed it to a model, commit it to a file.

Flags worth knowing

FlagMeaning
-n, --max-results1–50, defaults to 10
-s, --servicePick an engine; omit to race several
-c, --crawl <N>Crawl the top N results for full text
--include / --excludeRestrict or exclude sites
-t, --time <day|month|year>Time range
--jsonRaw JSON instead of formatted output

-c/--crawl is the same deep-search feature as the API's crawl_results, and bills the same way: 1 credit for the search plus 1 per page successfully crawled. See Credits and limits.

The s1 reasoning command is currently unavailable while the underlying service is rebuilt.

Source: github.com/fatwang2/search1api-cli

On this page