Call the hosted Blocket.se Scraper from Python using the official apify-client.
pip install apify-clientfrom apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("logiover/blocket-se-scraper").call(run_input={
"searchQuery": "Volvo",
"category": "car",
"location": "0.300001", # Stockholm
"maxResults": 100,
})
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(f"Got {len(items)} listings")
for x in items[:10]:
print(x["title"], x.get("priceValue"), x.get("location"))import pandas as pd
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("logiover/blocket-se-scraper").call(run_input={
"searchQuery": "V70",
"category": "car",
"maxResults": 300,
})
df = pd.DataFrame(client.dataset(run["defaultDatasetId"]).list_items().items)
print(df[["make", "model", "year", "mileageValue", "fuel", "priceValue"]].head())- Get your token from the Apify Console.
- All input fields are optional;
{}browses all of Sweden. - Category
car/mc/boatpopulates the vehicle fields. - Full field reference: see the main README.