npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lucaspon/olx-cli

v1.1.2

Published

Busque anúncios do OLX Brasil direto pelo terminal

Readme

olx-cli

Busque anúncios do OLX Brasil direto pelo terminal. Sem navegador, sem anúncios, sem cadastro — só os resultados.

Instalação

Via npm (recomendado)

npm install -g olx-cli

Via npx (sem instalar)

npx olx-cli search "iphone 15"

Do código-fonte

git clone https://github.com/YOUR_USERNAME/olx-cli.git
cd olx-cli
npm install
npm run build
npm link

Uso

olx search <query> [options]

Opções

| Opção | Descrição | |-------|-----------| | -u, --url <url> | Usar uma URL de busca do OLX diretamente | | -c, --category <cat> | Slug da categoria (ex: informatica, imoveis, eletronicos) | | --min-price <n> | Preço mínimo em R$ | | --max-price <n> | Preço máximo em R$ | | --condition <new\|used> | Filtrar por condição | | --filter-substring <text> | Excluir anúncios cujo título contenha esse texto | | -p, --pages <n> | Quantidade de páginas a buscar (padrão: 1) | | -l, --limit <n> | Máximo de anúncios a retornar | | -f, --format <format> | Formato de saída: table (padrão), json, csv | | -s, --sort <sort> | Ordenar por: price-asc, price-desc, date |

Exemplos

Busca básica:

olx search "rtx 4090"

Com filtros de preço:

olx search "playstation 5" --min-price 2000 --max-price 3500 --condition used

Múltiplas páginas, saída JSON:

olx search "macbook pro" --pages 3 --format json > resultados.json

Usando uma URL do OLX:

olx search --url "https://www.olx.com.br/informatica/placas-de-video?q=rtx+4090"

Categoria + ordenado pelo mais barato:

olx search "iphone" --category eletronicos --sort price-asc

Exportar CSV:

olx search "guitarra" --pages 2 --format csv > guitarras.csv

Excluir anúncios pelo título:

olx search "iphone 15" --filter-substring "Pro"

Stats

Após toda busca search, o CLI exibe automaticamente um bloco de estatísticas + histograma de preços no stderr:

  Stats
  ──────────────────────────────────────────
  Count              20
  Min          R$ 2.852
  Median       R$ 3.875
  Mean         R$ 3.942
  Max          R$ 5.399
  StdDev         R$ 770
  ──────────────────────────────────────────

  Price Histogram
  ────────────────────────────────────────────────────────────────────────────
  R$ 2.852 – R$ 3.107    ████████████████████████████████████████████████   6 30.0%
  ...

Multisearch

Compare preços entre múltiplas buscas (até 5) com tabela dinâmica e histogramas:

olx multisearch "iphone 15" "iphone 14" "iphone 13" --pages 1 --limit 10

Saída:

  ─────────────────────────────────────────────
             │ iphone 15 │ iphone 14 │ iphone 13
  ─────────────────────────────────────────────
  Count      │ 10        │ 10        │ 10
  Min        │ R$ 2.852  │ R$ 2.450  │ R$ 2.099
  Median     │ R$ 3.575  │ R$ 3.199  │ R$ 2.895
  Mean       │ R$ 3.751  │ R$ 3.234  │ R$ 2.923
  Max        │ R$ 5.399  │ R$ 4.099  │ R$ 3.699
  StdDev     │ R$ 839    │ R$ 578    │ R$ 456
  ─────────────────────────────────────────────

Com filtros:

olx multisearch "rtx 4090" "rtx 4080" "rtx 4070" --category informatica --min-price 3000

Excluindo anúncios pelo título:

olx multisearch "iphone 15" "iphone 14" --filter-substring "Pro" --limit 8

Formatos de Saída

Table (padrão)

Tabelas formatadas com bordas Unicode, cabeçalhos em cores e link clicável (🔗 Open) com a URL completa do anúncio:

┌────────────┬───────────┬──────────────────────────────────────────┬─────────┐
│ ID         │ Price     │ Title                                    │ Link    │
├────────────┼───────────┼──────────────────────────────────────────┼─────────┤
│ 1497028850 │ R$ 10.000 │  RTX 4090 GameRock 24GB - Placa Gamer... │ 🔗 Open │
│ 1496994255 │ R$ 15.000 │ Rtx 4090 24gb Asus tuf                   │ 🔗 Open │
│ 1496919887 │ R$ 12.100 │ Rtx 4090 gigabyte gaming oc              │ 🔗 Open │
└────────────┴───────────┴──────────────────────────────────────────┴─────────┘

Found 3 ads

Clique em 🔗 Open para abrir o anúncio no navegador (funciona no iTerm2, VS Code Terminal, GNOME Terminal, etc.).

JSON

Array formatado com os objetos de anúncio contendo id, title, price, url, location, thumbnail, createdAt.

CSV

Linha de cabeçalho com id,title,price,url,location.

Créditos

A técnica de scraping foi descoberta e documentada por Augusto Carmo no repositório olx-monitor. Este CLI reutiliza essas mesmas ideias numa ferramenta simples de busca pelo terminal.

Aviso

Esta ferramenta é para uso educacional e pessoal. Respeite os termos de serviço do OLX e não sobrecarregue seus servidores.

Licença

MIT