Ingestion API
The ingestion API is used to send new device data to Edge Impulse. It's available on both HTTP and HTTPS endpoints, and requires an API key to authenticate.
With the ingestion API, you can upload the following types of files:
JPG, PNG images
MP4, AVI video files
WAV audio files
CBOR/JSON files in the Edge Impulse data acquisition format
CSV files in the Edge Impulse data acquisition format
Bounding_boxes.labels file, with or without the need to go through the uploader (as long as it's in the same batch).
There are three endpoints available:
POST /api/training/files
- for gathering training data.POST /api/testing/files
- for gathering testing data. If you have the 'Live classification' page open in your browser the file will automatically be classified against the current impulse.POST /api/anomaly/files
- for anomaly data from deployed devices.
The following legacy endpoints are also available (however, the previous three endpoints listed are preferred):
POST /api/training/data
POST /api/testing/data
POST /api/anomaly/data
The API is located at:
HTTP
http://ingestion.edgeimpulse.com
HTTPS
https://ingestion.edgeimpulse.com
Header Parameters
x-api-key
- API Key (required).x-label
- Label (optional). If this header is not provided a label is automatically inferred from the filename through the following regex:^[a-zA-Z0-9\s-_]+
- For example: idle.01 will yield the label idle.x-disallow-duplicates
- When set, checks the hash of the message against your current dataset (optional). We'd recommend to set this header, but haven't enabled it by default for backwards compatibility.x-add-date-id
: 1 - to add a date ID to the filename. For example: if you upload with filename test.wav the file name will be test - set this option and we'll add a unique ID to the end (this is what we use on the daemon to create unique names).Content-type
- format of data used. Can beapplication/cbor
,application/json
,multipart/form-data
.
Response
All responses are sent with content type text/plain
. The following response codes may be returned:
200
- Stored the file, file name is in the body.400
- Invalid message, e.g. fields are missing, or are invalid. See body for more information.401
- Missing x-api-key header, or invalid API key.421
- Missing header, see body for more information.500
- Internal server error, see body for more information.
Example Usage
curl -X POST \
-H "x-api-key: ei_238fae..." \
-H "x-label: car" \
-H "Content-Type: multipart/form-data" \
-F "[email protected]" \
-F "[email protected]" \
https://ingestion.edgeimpulse.com/api/training/files
Last updated
Was this helpful?