Skip to main content

A python API wrapper for blocket.se

Project description

BlocketAPI

PyPI version License Python PyPI - Downloads

BlocketAPI allows users to search blocket.se for ads.

Blocket is one of Sweden's largest online marketplaces. It was founded in 1996 and allows users to buy and sell a wide range of items, including cars, real estate, jobs, services, and second-hand goods. The platform is known for its extensive reach and user-friendly interface, making it a popular choice for Swedes looking to purchase or sell items quickly and efficiently.

[!NOTE]
Blocket recently released a new version of their site which caused this package to break. But do not fear, we are actively working to try and restore all functionality. More info in issue #43.

🧑‍💻️ Install

Install BlocketAPI via PyPI...

pip install blocket-api

or use blocket-api.se without installing anything!

💁‍♀️ Usage

from blocket_api import (
    BlocketAPI,
    Category,
    CarColor,
    CarModel,
    CarSortOrder,
    CarTransmission,
    Location,
)

api = BlocketAPI()

# search all of blocket
api.search(
    "Vinterdäck Audi",
    sort_order=SortOrder.PRICE_ASC,
    locations=[Location.STOCKHOLM, Location.UPPSALA],
    category=Category.FORDONSTILLBEHOR,
)

# search for cars only
api.search_car(
    "Audi", # query is optional
    sort_order=CarSortOrder.MILEAGE_ASC,
    models=[CarModel.AUDI],
    colors=[CarColor.GULD],
    price_from=10000,
    price_to=50000,
    transmissions=[CarTransmission.MANUAL],
    locations=[Location.STOCKHOLM],
)

# Get a recommerce or car ad
from blocket_api import CarAd, RecommerceAd

api.get_ad(RecommerceAd(12345678))
api.get_ad(CarAd(12345678))

📝 Notes

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_api-0.3.92.tar.gz (10.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_api-0.3.92-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file blocket_api-0.3.92.tar.gz.

File metadata

  • Download URL: blocket_api-0.3.92.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for blocket_api-0.3.92.tar.gz
Algorithm Hash digest
SHA256 be8d35d3c7f46b23cb492d7cf1a1631fb88f8038ff9c9dd5e7e2f7c2cae10e62
MD5 58139d8da15dbf6faf5cd9885c7d0504
BLAKE2b-256 76745d30725c2352cade1828efac3ea1b8b43c97b8dd6597e74da8854bde5b10

See more details on using hashes here.

File details

Details for the file blocket_api-0.3.92-py3-none-any.whl.

File metadata

  • Download URL: blocket_api-0.3.92-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for blocket_api-0.3.92-py3-none-any.whl
Algorithm Hash digest
SHA256 3a4dc55c784716c07d6f4b1892ad0ee3959bec7c0186f5d329eff5d3f7e7a937
MD5 0cff01b484caf9dd0821887437e9ecc8
BLAKE2b-256 02a316f42c9c8391e37a1832aa5c48206e023334fb963fd622d8de1771efe437

See more details on using hashes here.

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