1. Inferences
  2. Item Labels Inference

Inferences

Item Labels Inference

You can have the inference via the API or the vision-SDK while the vision-SDK will do the network request for you, the responses from this document will remain the same.

New Inference

POST
`/v1/inferences`

To create a new inference for item labels, you'll need to pass the image as a base64 encoded data URL or public web URL. There's a soft cap of about 7.5MB per image for the base64 URL.

You're also able to specify what type of image the parser is looking at, so it can better extract data accurately along with other helpful information listed below:

image string (required)
Base64 encoded image.

barcode_values Array.<String>
Any existing values you've already extracted from the barcode.

For example,

js
        const data = {
  image: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASA...", //truncated
  location_id: null, //You an optionally pass the location ID to later filter scans by location
};

const res = await fetch("https://api.packagex.io/v1/inferences/images/item-labels", {
  method: "POST",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(data),
}).then((res) => res.json());

const scan = response.data;