Ruby REST API for vehicle catalog navigation data.
- Roda for routing
- Puma for Rack serving
- Nokogiri for HTML parsing
- RSpec for tests
bundle install
bundle exec pumaThe app runs from config.ru.
The API is mounted directly at the root path. Example base URL:
http://127.0.0.1:9292
GET /health
GET /brands
GET /brands/:id
GET /brands/:id?region=:region
GET /brands/:id/:model
GET /brands/:id/:model/:frame
GET /brands/:id/:model/:frame/:complectation
GET /brands/:id/:model/:frame/:complectation/:group
GET /brands/:id/:model/:frame/:complectation/:group/:section
GET /brands/:id/:model/:frame/:complectation/:group/:section/:pncPath parameters:
:idis the brand slug, such astoyota,honda,kia, orhyundai.:modelis the model slug from a brand catalog response.:frameis the frame slug from a model catalog response.:complectationis the complectation slug from a frame catalog response.:groupis usuallyengine,chassis,body,electric, orquick.:sectionis the parts section code.:pncis the part number code.:regionis optional. Supported values are usuallyjapan,europe,general, andusa.
GET /health{
"name": "string",
"status": "string"
}GET /brands[
{
"name": "string",
"slug": "string",
"endpoint": "string",
"regions": [
{
"name": "string",
"slug": "string",
"endpoint": "string"
}
]
}
]GET /brands/:id
GET /brands/:id?region=:region{
"brand": "string",
"slug": "string",
"endpoint": "string",
"title": "string",
"current_region": "string",
"other_regions": [
{
"name": "string",
"slug": "string",
"endpoint": "string"
}
],
"models": [
{
"name": "string",
"slug": "string",
"endpoint": "string"
}
]
}GET /brands/:id/:model{
"brand": "string",
"model": "string",
"slug": "string",
"endpoint": "string",
"title": "string",
"frames": [
{
"name": "string",
"slug": "string",
"endpoint": "string"
}
]
}GET /brands/:id/:model/:frame{
"brand": "string",
"model": "string",
"frame": "string",
"slug": "string",
"endpoint": "string",
"title": "string",
"complectations": [
{
"name": "string",
"slug": "string",
"endpoint": "string",
"engine": "string",
"production_period": "string",
"body": "string",
"grade": "string",
"transmission": "string",
"options": "string"
}
]
}GET /brands/:id/:model/:frame/:complectation{
"brand": "string",
"model": "string",
"frame": "string",
"complectation": "string",
"slug": "string",
"endpoint": "string",
"title": "string",
"details": {
"production_period": "string",
"catalog_code": "string",
"complectation": "string",
"engine": "string",
"body": "string",
"grade": "string",
"transmission": "string",
"options": "string"
},
"parts_groups": [
{
"name": "string",
"slug": "string",
"endpoint": "string"
}
],
"quick_parts": {
"name": "string",
"slug": "string",
"endpoint": "string"
}
}Valid group slugs are usually engine, chassis, body, electric, and quick.
GET /brands/:id/:model/:frame/:complectation/:group{
"brand": "string",
"model": "string",
"frame": "string",
"complectation": "string",
"group": "string",
"slug": "string",
"endpoint": "string",
"title": "string",
"sections": [
{
"code": "string",
"name": "string",
"slug": "string",
"endpoint": "string",
"image": "string"
}
],
"parts": []
}GET /brands/:id/:model/:frame/:complectation/quick{
"brand": "string",
"model": "string",
"frame": "string",
"complectation": "string",
"group": "string",
"slug": "string",
"endpoint": "string",
"title": "string",
"sections": [],
"parts": [
{
"group": "string",
"name": "string",
"oem": "string",
"production_period": "string",
"applicability": "string",
"advance_order_price": "string",
"supplier_url": "string"
}
]
}GET /brands/:id/:model/:frame/:complectation/:group/:section{
"brand": "string",
"model": "string",
"frame": "string",
"complectation": "string",
"group": "string",
"section": "string",
"endpoint": "string",
"title": "string",
"schemes": [
{
"name": "string",
"image": "string",
"full_size_endpoint": "string"
}
],
"related_parts": [
{
"pnc": "string",
"name": "string",
"endpoint": "string"
}
]
}GET /brands/:id/:model/:frame/:complectation/:group/:section/:pnc{
"brand": "string",
"model": "string",
"frame": "string",
"complectation": "string",
"group": "string",
"section": "string",
"pnc": "string",
"endpoint": "string",
"title": "string",
"selected_parts": [
{
"number": "string",
"pnc": "string",
"oem": "string",
"required_per_car": "string",
"production_period": "string",
"name": "string",
"applicability": "string",
"advance_order_price": "string",
"supplier_url": "string"
}
],
"references": [
{
"period_marker": "string",
"frame": "string",
"note": "string"
}
],
"schemes": [
{
"name": "string",
"image": "string",
"full_size_endpoint": "string"
}
],
"related_parts": [
{
"pnc": "string",
"name": "string",
"endpoint": "string"
}
]
}{
"error": {
"type": "string",
"message": "string"
}
}The scraper keeps a small in-memory cache and retries rate-limited requests, but EPC Data may still return 429 when it receives too many requests.
controllers/
models/
router/
router/routes/
services/
spec/
utils/
app.rb
config.ru