Vehicore
Getting started

Get Started

Set up your API key and make your first request.

This tutorial will walk you through getting your API key and making your first VehiCore request. Copy-paste examples are provided for cURL, Node.js, Python, Java, and Go.

1. Your API key

This key was automatically generated for you when you registered. Copy it and store it securely. You can retrieve or create new keys anytime from the API keys page.

2. Set your API key

Add your key to .env or create the file if it doesn't exist. For security, we recommend using environment variables in production.

.env

# VehiCore API key (get yours from the dashboard)
VEHICORE_API_KEY=your_api_key_here

3. Make your first request

Send your API key as an X-API-Key header on every request to VehiCore API endpoints.

curl -X POST "https://vehicore-api.dev-stage.fyi/api/ocr/plate" \
  -H "X-API-Key: $VEHICORE_API_KEY" \
  -F "image=@/path/to/image.jpg" \
  -F "userLanguage=en"
import fs from 'node:fs';

const formData = new FormData();
const imageBuffer = fs.readFileSync('/path/to/image.jpg');
formData.append('image', new Blob([imageBuffer], { type: 'image/jpeg' }), 'image.jpg');
formData.append('userLanguage', 'en');

const response = await fetch('https://vehicore-api.dev-stage.fyi/api/ocr/plate', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.VEHICORE_API_KEY,
  },
  body: formData,
});

const data = await response.json();
console.log(data);
import os
import requests

url = "https://vehicore-api.dev-stage.fyi/api/ocr/plate"
headers = {"X-API-Key": os.environ["VEHICORE_API_KEY"]}
files = {"image": open("/path/to/image.jpg", "rb")}
data = {"userLanguage": "en"}

response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())
// Using OkHttp (add dependency: com.squareup.okhttp3:okhttp)
import okhttp3.*;
import java.io.File;

OkHttpClient client = new OkHttpClient.Builder().build();
RequestBody body = new MultipartBody.Builder()
    .setType(MultipartBody.FORM)
    .addFormDataPart("image", "image.jpg",
        RequestBody.create(new File("/path/to/image.jpg"), MediaType.parse("image/jpeg")))
    .addFormDataPart("userLanguage", "en")
    .build();

Request request = new Request.Builder()
    .url("https://vehicore-api.dev-stage.fyi/api/ocr/plate")
    .header("X-API-Key", System.getenv("VEHICORE_API_KEY"))
    .post(body)
    .build();

try (Response response = client.newCall(request).execute()) {
    System.out.println(response.body().string());
}
package main

import (
    "bytes"
    "io"
    "mime/multipart"
    "net/http"
    "os"
)

func main() {
    body := &bytes.Buffer{}
    w := multipart.NewWriter(body)

    f, _ := os.Open("/path/to/image.jpg")
    part, _ := w.CreateFormFile("image", "image.jpg")
    io.Copy(part, f)
    f.Close()
    w.WriteField("userLanguage", "en")
    w.Close()

    req, _ := http.NewRequest("POST", "https://vehicore-api.dev-stage.fyi/api/ocr/plate", body)
    req.Header.Set("X-API-Key", os.Getenv("VEHICORE_API_KEY"))
    req.Header.Set("Content-Type", w.FormDataContentType())

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()
    io.Copy(os.Stdout, resp.Body)
}

How it works

Your API key authenticates your requests and tracks your usage. You start with a free tier that includes credits for testing. Once you've used your key at least once, we'll redirect you to the Usage page by default.

Free tier included

Your API key gives you access to a free tier with credits to get started. You can purchase additional credits from the Billing page.

On this page