Convermax npm package
A lightweight JavaScript client for Convermax Year-Make-Model (YMM) vehicle search API.
Installation
npm install @convermax/api
Usage examples
Search by Vehicle
In your JS code:
import Convermax from '@convermax/api';
const storeId = 'your-store-id';
// Define vehicle parametersconst vehicle = { Year: 2020, Make: 'Toyota', Model: 'Corolla',};
// Search for products matching the vehicleconst results = await Convermax.searchByVehicle(storeId, vehicle);
console.log(results);/* Example output (array of products):[ { "id": "6761941303496", "title": "K&N Universal Rubber Filter 5in Flange ID...", "url": "/products/k-n-universal-rubber-filter-5in-flange-id-x-6-5in-base-od-x-4-5in-top-od-x-4-125in-height", "price": 48.99, "image": "https://cdn.shopify.com/s/files/1/0562/7704/1352/products/5d64409aa1a444d96889ef0d01b5169a.jpg?v=1619199536", // ... other fields }, // ... more products]*/
Search with Pagination
// Search with pagination optionsconst paginatedResults = await Convermax.searchByVehicle(storeId, vehicle, { page: 1, pageSize: 24,});
// Or specify only one pagination parameterconst resultsWithPage = await Convermax.searchByVehicle(storeId, vehicle, { page: 2,});
Get Product Fitments
// Get fitment information for a specific productconst productId = '1234554321';const fitments = await Convermax.getFitments(storeId, productId);
console.log(fitments);/* Example output - Vehicle Specific:{ "Fitment": "Vehicle Specific", "Fields": ["Year", "Make", "Model", "Submodel"], "Fitments": [ { "Year": "2018 - 2023", "Make": "BMW", "Model": "530e", "Submodel": "Base" }, { "Year": "2017 - 2023", "Make": "BMW", "Model": "530i", "Submodel": "Base" }, { "Year": "2020 - 2025", "Make": "BMW", "Model": "840i", "Submodel": "Base" } // ... more fitments ]}*/
/* Example output - Many Fitments (when product has >1000 fitments): Note: "Many Fitments" indicates the product fits more than 1000 vehicles. Only the first 1000 fitments are returned due to response size limits.{ "Fitment": "Many Fitments", "Fields": ["Make", "Model", "Year", "Submodel", "Engine"], "Fitments": [ { "Year": "2010", "Make": "Chevrolet", "Model": "Camaro", "Submodel": "LS", "Engine": "V6 3.6L" }, { "Year": "2011", "Make": "Chevrolet", "Model": "Camaro", "Submodel": "LS", "Engine": "V6 3.6L" }, { "Year": "2020", "Make": "Chevrolet", "Model": "Camaro", "Submodel": "LT/1LE", "Engine": "I4 2.0L" } // ... up to 1000 fitments total ]}*/
/* Example output - Universal Fit:{ "Fitment": "Universal Fit", "Fields": [], "Fitments": []}*/
/* Example output - No Fitment Data:{ "Fitment": "No Fitment Data", "Fields": [], "Fitments": []}*/
API Reference
searchByVehicle(storeId, vehicle, options?)
storeId
(string): Your Convermax store identifiervehicle
(object): Vehicle parameters (Year, Make, Model, etc.)options
(object, optional): Pagination optionspage
(number, optional): Page number for paginationpageSize
(number, optional): Number of items per page
Returns: Promise
getFitments(storeId, productId)
storeId
(string): Your Convermax store identifierproductId
(string): Product ID to get fitment data for
Returns: Promise