Blocket APIblocket.se ↗
Search and retrieve second-hand items, car listings, and rental housing data from Blocket.se and Qasa.se via 6 structured endpoints.
What is the Blocket API?
The Blocket.se API gives developers access to 6 endpoints covering Sweden's largest classifieds marketplace, including second-hand goods, cars, and rental housing. The search_listings endpoint returns paginated summaries with price, location, image URLs, and listing attributes, while get_listing_detail and get_car_listing_detail expose full structured data for individual ads. Coverage spans Blocket Torget, Blocket Mobility, and Qasa rental listings.
curl -X GET 'https://api.parse.bot/scraper/7e413c69-4d2e-404b-9a0e-2b3b4ab4d511/search_listings?page=1&sort=RELEVANCE&query=iPhone' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace blocket-se-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Blocket.se SDK — search items, cars, housing, and browse categories."""
from parse_apis.blocket_se_api import Blocket, Sort, ListingNotFound
client = Blocket()
# Search second-hand marketplace for iPhones, sorted by price descending
for listing in client.listingsummaries.search(query="iPhone", sort=Sort.PRICE_DESC, limit=3):
print(listing.heading, listing.location, listing.canonical_url)
# Drill into the first result's full details
item = client.listingsummaries.search(query="cykel", limit=1).first()
if item:
detail = item.details()
print(detail.title, detail.price, detail.description[:80])
# Search cars and inspect one
car = client.carsummaries.search(query="Volvo", sort=Sort.PRICE_ASC, limit=1).first()
if car:
print(car.heading, car.make, car.model, car.year, car.mileage)
car_detail = car.details()
facts = car_detail.advertising_facts
print(facts["make_text"], facts["fuel"])
# Check housing availability in Stockholm
housing = client.housingcounts.search(location_identifier="se/stockholms_kommun")
print(housing.total_count)
# Handle a not-found listing gracefully
try:
gone = client.listingsummaries.search(query="nonexistent_xyz_item_12345", limit=1).first()
if gone:
gone.details()
except ListingNotFound as exc:
print(f"Listing gone: {exc.item_id}")
# Browse category constraint rules
for rule in client.categoryrules.list(limit=3):
print(rule.parameters, rule.allow_all)
print("exercised: listingsummaries.search / details / carsummaries.search / details / housingcounts.search / categoryrules.list")
Full-text search over Blocket Torget (second-hand marketplace). Returns paginated listing summaries ordered by the chosen sort. Each result carries price, location, and image URLs. Paginate via page parameter; total count indicates available results.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number for pagination |
| sort | string | Sort order for results |
| queryrequired | string | Search keyword |
{
"type": "object",
"fields": {
"url": "string search URL used",
"total": "integer total number of results",
"listings": "array of listing summary objects with heading, price, location, canonical_url, ad_id, image_urls, extras"
},
"sample": {
"data": {
"url": "https://www.blocket.se/recommerce/forsale/search?q=iPhone&sort=RELEVANCE",
"total": 53,
"listings": [
{
"ad_id": 23981787,
"brand": "Apple",
"price": {
"amount": 8800,
"price_unit": "kr",
"currency_code": "SEK"
},
"heading": "iPhone 16 PRO",
"location": "Borås",
"image_urls": [
"https://images.blocketcdn.se/dynamic/default/item/23981787/0979214d"
],
"trade_type": "Säljes",
"canonical_url": "https://www.blocket.se/recommerce/forsale/item/23981787"
}
]
},
"status": "success"
}
}About the Blocket API
Search and Browse Listings
The search_listings endpoint accepts a required query string and optional page and sort parameters, returning an array of listing summary objects. Each object includes heading, price, location, canonical_url, ad_id, image_urls, and an extras array of attributes. The total field tells you how many results exist across all pages. The search_cars endpoint works similarly for Blocket Mobility, adding vehicle-specific fields: make, model, year, mileage, fuel, and transmission. When sorting by PRICE_ASC, leasing listings with low monthly amounts may surface at the top of results.
Listing Detail Endpoints
get_listing_detail takes an item_id (the ad_id from search results) and returns the full listing record: price in SEK, title, description, a category object with nested parent categories, an images array with uri, width, and height, a location object with postalCode, postalName, countryCode, and GPS coordinates, and an extras array of labeled attribute key-value pairs. get_car_listing_detail returns advertising_facts — a flat key-value object including fuel, year, price, mileage, make_text, model_text, body_type, and transmission — alongside schema_data containing schema.org BreadcrumbList structured data. Both detail endpoints return input_not_found for expired or removed listings, so use fresh ad_id values from search results.
Housing and Category Data
search_housing queries rental listing counts on Qasa.se using a location_identifier string such as se/stockholms_kommun or se/göteborgs_kommun. It returns a single total_count integer indicating available rentals in that area. get_categories requires no inputs and returns the full category constraint ruleset for Blocket marketplace listings, including allowedCombinations and excludedCombinations pairings for category and trade type — useful for validating listing filters or building category-aware search tools.
The Blocket API is a managed, monitored endpoint for blocket.se — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when blocket.se changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official blocket.se API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track second-hand price trends for specific product keywords using
search_listingsprice and extras fields. - Build a car comparison tool using make, model, year, mileage, and fuel data from
search_carsandget_car_listing_detail. - Monitor rental housing availability in Swedish municipalities by polling
search_housingwith differentlocation_identifiervalues. - Aggregate category-filtered listings for resellers by combining
get_categoriesconstraint rules with paginatedsearch_listingsqueries. - Enrich a listing database with full descriptions, GPS coordinates, and image URLs via
get_listing_detail. - Detect expired listings in a dataset by checking for
input_not_foundresponses from the detail endpoints.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Blocket.se have an official developer API?+
What does `get_car_listing_detail` return compared to `search_cars`?+
search_cars returns summary-level fields — make, model, year, mileage, fuel, transmission, and price — useful for scanning many listings. get_car_listing_detail returns advertising_facts, a structured key-value object with the same core fields plus body_type and make_text/model_text as separate string fields, along with schema_data containing schema.org BreadcrumbList data for the listing's category path.Does the `search_housing` endpoint return individual rental listings or just a count?+
search_housing returns only a total_count integer for the specified Qasa area identifier. It does not return individual listing records, addresses, prices, or landlord details. You can fork this API on Parse and revise it to add an endpoint that retrieves individual Qasa rental listing details.Are there any quirks with expired listings when using the detail endpoints?+
get_listing_detail and get_car_listing_detail return input_not_found when the ad_id corresponds to a listing that has been removed or has expired. Blocket listings can be taken down quickly after a sale, so ad IDs retrieved from search results should be used promptly.