Guides: Quickstart
Quickstart
Make your first call to the Motorbay API in about five minutes. You need an email address and a terminal with curl. The Free plan needs no card.
1. Create an account
Open Motorbay Console and create an account on the Sign Up tab. Use an email address you can read now.
2. Confirm your email
We send you a link. Open it to confirm your email. You can't create API keys until you do. The console says "Verify your email to create API keys." until then.
3. Create an API key
Every new account starts on the Free plan, with no card and nothing to choose first. Pricing shows how many requests Free includes each month.
On the dashboard, choose Create key. Name it after where you'll use it, for example "Production server".
The key is shown once. Copy it now and keep it somewhere safe. We store only a hash, so a lost key can't be recovered. Put it in an environment variable:
export MOTORBAY_API_KEY="mbk_live_…"4. Make your first call
Send the key in the X-Api-Key header. This lists the first three vehicle kinds:
curl -H "X-Api-Key: $MOTORBAY_API_KEY" \
"https://api.motorbay.app/v1/kinds?pageSize=3"A 200 looks like this:
{
"data": [
{ "id": "1", "name": "Personbil", "originalName": "Personbil" },
{ "id": "2", "name": "Stor personbil", "originalName": "Stor personbil" },
{ "id": "3", "name": "Varebil", "originalName": "Varebil" }
],
"metadata": { "page": 1, "pageSize": 3, "totalCount": 15, "totalPages": 5 }
}5. Look up a vehicle
Look up a vehicle by registration number:
curl -H "X-Api-Key: $MOTORBAY_API_KEY" \
"https://api.motorbay.app/v1/vehicles/plate/AB12345"You get the vehicle as JSON, or a 404 with the code VehicleNotFound if no vehicle has that registration number. AB12345 is a sample. Use a plate you know.
Add include to get parts of the vehicle in the same answer, still as one request:
curl -H "X-Api-Key: $MOTORBAY_API_KEY" \
"https://api.motorbay.app/v1/vehicles/plate/AB12345?include=engine,inspection"The answer gains engine and inspection, the same objects as /v1/vehicles/{id}/engine and /v1/vehicles/{id}/inspection. include=all adds every part. Not sure if you have a plate or a VIN? /v1/vehicles/lookup/{plateOrVin} takes either.
Use Postman instead
Download the Postman collection and import it in Postman with Import. It has every endpoint, built from the same OpenAPI document as the API reference. Open the collection's Variables tab and paste your key into apiKey. The collection sends it in the X-Api-Key header for every request. The collection ships with apiKey empty, so don't share an exported copy after you fill it in.
If something goes wrong
401withApiKeyMissing: theX-Api-Keyheader is missing. Check that the variable is set withecho $MOTORBAY_API_KEY.401withApiKeyInvalid: the key is wrong, revoked, or expired. Create a new one.402withPaymentRequired: your paid subscription is in a state we can't confirm. Open the billing portal from your account page, or email support.429withQuotaExceeded: the Free requests for this month are used. They come back on the 1st, or you can upgrade on Pricing.429withRateLimitExceeded: you sent more than 60 requests in a minute. Wait the seconds in theRetry-Afterheader.
Next
- Authentication and API keys
- Errors
- API reference, with every endpoint and field
Didn't find the answer? Email support@motorbay.app.