Riyasewana APIriyasewana.com ↗
Access Sri Lanka vehicle listings from Riyasewana via API. Browse by category, search with filters, and retrieve full specs, images, and seller info.
What is the Riyasewana API?
The Riyasewana API exposes 3 endpoints covering Sri Lanka's largest vehicle marketplace, returning listings across cars, SUVs, motorcycles, lorries, and more. The get_listings endpoint delivers paginated results by category with title, price, year, city, mileage, and posting date, while search_vehicles lets you filter by make, model, fuel type, transmission, price range, and year range. A third endpoint retrieves full listing details including high-resolution images and vehicle options.
curl -X GET 'https://api.parse.bot/scraper/a20b5c9d-d197-43eb-a622-4b464d151c87/get_listings?page=1&category=cars' \ -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 riyasewana-com-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.
from parse_apis.riyasewana_vehicle_marketplace_api import Riyasewana, Category, FuelType, Transmission
client = Riyasewana()
# Browse SUV listings by category
for listing in client.listingsummaries.by_category(category=Category.SUVS, limit=5):
print(listing.title, listing.price, listing.city)
# Search for automatic Toyota vehicles
for result in client.listingsummaries.search(make="Toyota", transmission=Transmission.AUTOMATIC, limit=3):
print(result.title, result.year, result.mileage)
# Drill into full details
detail = result.details()
print(detail.make, detail.model, detail.fuel_type, detail.engine_cc)
# Fetch a specific listing directly by URL
car = client.listings.get(url="https://riyasewana.com/buy/toyota-prius-sale-colombo-12345678")
print(car.title, car.price, car.gear, car.posted_location)
Fetch paginated vehicle listings for a given category. Returns up to 40 listings per page. Categories map to the site's main navigation sections. Pagination is page-number based; total_results reflects the category's full inventory size.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number for pagination. |
| category | string | Vehicle category slug. |
{
"type": "object",
"fields": {
"page": "integer - current page number",
"category": "string - the requested category slug",
"listings": "array of ListingSummary objects",
"total_results": "integer - total number of listings in this category"
},
"sample": {
"data": {
"page": 1,
"category": "cars",
"listings": [
{
"url": "https://riyasewana.com/buy/suzuki-baleno-turbo-sale-kesbewa-11750331",
"city": "Kesbewa",
"year": "2016",
"price": "Rs. 7,690,000",
"title": "Suzuki Baleno Turbo 2016 Car",
"mileage": "102,000 km",
"thumbnail": "https://riyasewana.com/thumb/thumbsuzuki-baleno-413194010191.jpg",
"date_posted": "Jun 7"
}
],
"total_results": 14985
},
"status": "success"
}
}About the Riyasewana API
Browse and Search Vehicle Listings
The get_listings endpoint returns up to 40 vehicles per page for eight category slugs: cars, suvs, vans, motorcycles, three-wheels, pickups, lorries, and heavy-d. Each listing in the response includes title, url, thumbnail, city, price, year, mileage, and date_posted, plus a total_results count for the full category. Paginate through results using the page parameter.
Filtered Search
search_vehicles accepts up to eight filter parameters simultaneously: make (e.g., Toyota, Honda), model (e.g., Prius, Alto), city (e.g., Colombo, Kandy), fuel (petrol, diesel, electric, hybrid), year_min, year_max, and price_max in LKR. The response mirrors the listings shape from get_listings and also returns a search_url field that encodes the resolved query, which you can use to anchor pagination across subsequent calls.
Full Listing Detail
get_listing_detail accepts any Riyasewana listing URL and returns the complete record: make, model, year, gear (transmission), price, options (comma-separated features), an images array of full-resolution URLs, and a contact field for the seller's phone number. Note that contact may be empty for some listings — the phone number is not guaranteed to be present in all cases.
Coverage Notes
All prices are denominated in LKR (Sri Lankan Rupees). The API covers the publicly visible listings on Riyasewana without requiring account authentication. Category slugs and fuel type values are fixed enumerations; passing an unsupported value will return no results rather than an error.
The Riyasewana API is a managed, monitored endpoint for riyasewana.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when riyasewana.com 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 riyasewana.com 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?+
- Build a price-tracker that monitors LKR asking prices for a specific make/model combination over time using
search_vehicles - Aggregate mileage and year distributions across the
carsorsuvscategory to analyze the Sri Lankan used-car market - Pull full-resolution listing images via
get_listing_detailto populate a vehicle comparison tool - Alert users when new motorcycles or three-wheelers appear in a target city by polling
get_listingswith the relevant category slug - Feed vehicle specs and options from
get_listing_detailinto an inventory database for a Sri Lankan dealership or broker - Filter by
fueltype (electric or hybrid) across cities to research EV availability in the Sri Lankan market - Map listings geographically by extracting the
cityfield from paginatedget_listingsresults
| 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 Riyasewana offer an official developer API?+
What does the `search_vehicles` endpoint return that `get_listings` does not?+
search_vehicles supports cross-cutting filters — make, model, city, fuel type, year range, and price ceiling — that get_listings does not. It also returns a search_url field encoding the resolved query, which is useful for stable pagination. Both endpoints return the same listing fields: title, url, thumbnail, city, price, year, mileage, and date_posted.Is the seller phone number always available in `get_listing_detail`?+
contact field in get_listing_detail is populated when a phone number is accessible, but it may be empty. Some listings require a user interaction on the site to reveal the number, and in those cases the field will return an empty string.Does the API cover commercial vehicles or only personal vehicles?+
category parameter in get_listings includes lorries, pickups, and heavy-d alongside personal-vehicle categories like cars, suvs, and motorcycles. All eight category slugs are supported for paginated browsing.Can I retrieve saved searches, user profiles, or dealer inventory pages?+
get_listings, filtered search via search_vehicles, and individual listing detail via get_listing_detail. User accounts, saved searches, and dealer profile pages are not exposed. You can fork this API on Parse and revise it to add an endpoint targeting dealer or seller profile pages.