Skip to main content

Fast CLI for searching Blocket.se — optimized for agents and scripting

Project description

blocket-cli

CI Python 3.10+ License: MIT

Fast CLI for searching Blocket.se — Sweden's largest marketplace.

Designed for agents, scripts, and quick terminal lookups. Minimal dependencies, structured output.

Install

pip install blocket-cli

Or with uv:

uv tool install blocket-cli

Usage

Search listings

blocket search "soffa"
blocket search "iphone 15" -l stockholm --price-max 8000
blocket search "mountainbike" -c sports --sort price-asc -n 10
blocket search "ps5" -c electronics -o json | jq '.results[:3]'

Get ad details

blocket ad 20851738
blocket ad 20851738 -o json

Browse filters

blocket categories
blocket locations

Output formats

Flag Format Use case
(default) Human-readable table Terminal browsing
-o json Compact JSON Piping to jq, API consumption
-o jsonl One JSON object per line Streaming, log processing

Search options

Option Description
-l, --location Filter by Swedish county (e.g. stockholm, skane)
-c, --category Filter by category (e.g. electronics, furniture)
--price-min Minimum price in SEK
--price-max Maximum price in SEK
--sort Sort order (relevance, price-asc, price-desc, date)
-n, --limit Max results to display
-p, --page Page number
-o, --output Output format (table, json, jsonl)

Agent integration

The JSON output is designed for LLM agents and automation:

# Structured search results
blocket search "cykel" -l stockholm --price-max 5000 -o json

# Stream results line by line
blocket search "soffa" -o jsonl

# Filter by category
blocket search "lampa" -c furniture -o json | jq '[.results[] | {title: .heading, price: .price.amount, location}]'

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blocket_cli-0.2.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blocket_cli-0.2.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file blocket_cli-0.2.0.tar.gz.

File metadata

  • Download URL: blocket_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for blocket_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d61ad342c456666ece3d6e19f5b74bfe97c1cf773d597f36bea9f6d005def4ee
MD5 8efdc27b2a4ffab678256df62d09350f
BLAKE2b-256 3ccd899e0f2362b1974352ef7ac08ba05463b30ed9ac89c306d5d9bb3de1c5dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for blocket_cli-0.2.0.tar.gz:

Publisher: publish.yml on lennart-johansson/blocket-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file blocket_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: blocket_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for blocket_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f7355d932050558f5feef8cfaf96955a6eb8000da32766c37c9714206943a70
MD5 70250d6880d988e7143a8b678f8a24ab
BLAKE2b-256 ee0fb58c073cc4d2f48f3e9c1891a44650423f3c28e5f548bcf024d273b40480

See more details on using hashes here.

Provenance

The following attestation bundles were made for blocket_cli-0.2.0-py3-none-any.whl:

Publisher: publish.yml on lennart-johansson/blocket-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page