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,
    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],
    locations=[Location.STOCKHOLM],
)

# 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,
)


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

api.get_ad(RecommerceAd(12345678))
api.get_ad(CarAd(12345678))
api.get_ad(BoatAd(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.93.tar.gz (10.5 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.93-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blocket_api-0.3.93.tar.gz
  • Upload date:
  • Size: 10.5 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.93.tar.gz
Algorithm Hash digest
SHA256 8c1494da2b8c8d1279e7ed0371c27f354ba80a931d6e89dd95e481774f147a46
MD5 aed571a6fae69ccb349215a42abc3970
BLAKE2b-256 75ffd17300dd2b3e5f891ba32abcbf225fe60e92fc88330a0d39c2cd04edeafb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blocket_api-0.3.93-py3-none-any.whl
  • Upload date:
  • Size: 10.1 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.93-py3-none-any.whl
Algorithm Hash digest
SHA256 7b5e4ba98d3048010f08dda016601249f5b5d07d3194cf8df2a133a989660d93
MD5 6926fb058c2820306408367e92f6662d
BLAKE2b-256 1859205d28d72f370f13fc20fd83bca5d378df8b5ee8b09f81656eebb5b708c6

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