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.

🧑‍💻️ 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,
    CarWheelDrive,
    Location,
)

api = BlocketAPI()

# search all of blocket
api.search(
    "Tamagotchi",
    sort_order=SortOrder.PRICE_ASC,
    locations=[Location.STOCKHOLM, Location.UPPSALA],
    category=Category.FRITID_HOBBY_OCH_UNDERHALLNING,
)

# search for cars
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],
    wheel_drive=[CarWheelDrive.RWD],
    locations=[Location.STOCKHOLM],
    horsepower_from=200,
    horsepower_to=300,
    org_id=1337, # dealer or store id
)

# search for boats
from blocket_api import BoatType

api.search_boat(
    "Mercury", # query is optional
    types=[BoatType.DAYCRUISER],
    locations=[Location.STOCKHOLM],
    length_from=10,
    length_to=15,    
    price_from=20000,
    price_to=90000,
    org_id=1337, # dealer or store id
)

# search for motorcycles
from blocket_api import McType, McModel

api.search_mc(
    "TC 150", # query is optional
    types=[McType.SPORT],
    locations=[Location.STOCKHOLM],
    models=[McModel.DUCATI],
    price_from=20000,
    price_to=90000,
    engine_volume_from=100,
    engine_volume_to=200,
    org_id=1337, # dealer or store id
)


# get ad details
from blocket_api import CarAd, RecommerceAd, BoatAd, McAd

api.get_ad(RecommerceAd(12345678))
api.get_ad(CarAd(12345678))
api.get_ad(BoatAd(12345678))
api.get_ad(McAd(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.5.1.tar.gz (12.0 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.5.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for blocket_api-0.5.1.tar.gz
Algorithm Hash digest
SHA256 d1e2853313505f4da3f9d81bcb74cb7b06e8f54ae6da8b3c13d5da015b7b49d9
MD5 1011d7fb5b0013cb2d7ca6aadb67c293
BLAKE2b-256 5002bab868b3b06b4582ce4d08cf3f7c07eaa0ecae58d4f6958789e4d6fc2737

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for blocket_api-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c493cb99c561a9b6c2319e5fed4b44df2c54722fdd58e9d86dc93c51560c1870
MD5 f0df18d539eb3d13e779a56fab6d0691
BLAKE2b-256 36dd645af566694fb7920242bb17e7c75787b8c58890ef149f1555c1a09cc080

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