Food E-Additives Recognition API - FoodEs is a cross browsers REST API which get a JSON input with a still photo (as base64 encoded string), containing food label with E-Additives codes like E100, E200 etc. and returns a JSON string which contains details of the eCodes detected and recognized in the label or input text. Those details include: name of the E-Additive, categories in which the E-Additive is used, restrictions or limitations of the E-Additive for each category of food. Of course, there are some limitations in order to get a higher accuracy. We recommend properly exposed, unobstructed JPEG photos at 1920x1080 (full HD resolution) where ratio between height of the eCode and height of entire picture should be at least 1:15. For ratios like 1:16, 1:17, 1:18 and so on the accuracy is lower and the AI algorithm may not see and read the eCode. We do not store pictures.
Allthough this Food E-Additives Detection API (currently we do not offer a Food E-Additives Recognition sdk) is intended for software development and therefore developers, we have also here a Food E-Additives Recognition online application that may be used to check the input and output JSONs of the API. The necessary steps are written below, basically for this real time Food E-Additives Recognition API you send an authorized POST request in JSON format to the API endpoint and you get as JSON response the output as described below through parameters and examples.
This Food E-Additives Detection API is useful for a large number of domains like: food processors, retailers, customers, IT developers etc. You own the commercial copyright of the resulted JSON with no additional fee meaning you may use it in your own apps for sale.
For using our Food E-Additives Recognition API and/or APP you must create an account (free of charge, no card required), activate it from your received email, login and then start your TRIAL package with no fees as you can see at our pricing packages. After you have tested the API and/or APP and you are satisfied, you may buy a paid package. You will always see at your Admin Console page the real resources consumption in real time, your invoices, you may see/edit/delete your profile or export log consents as GDPR instructed, you may read our FAQs.
https://gatiosoft.ro/foodes.aspx
Authorization: Basic //Your username:password are base64 encoded string Content-Type: application/json Accept: application/json
{ "base64ImageString": "iVBORw0KGgoAAAA...base64 encoded string photo...GAAAAAElFTkSuQmCC", "eCode": "NO" }
[ { "eCode": "E100", "eName": "Curcumin", "categoryNo": "14.2.7.2", "category": "Aromatised wine-based drinks (14.2.7.2)", "restriction": "ML = 100 mg/l, only bitter soda" }, { "eCode": "E101", "eName": "Riboflavins", "categoryNo": "04.2.3", "category": "Canned or bottled fruit and vegetables (4.2.3)", "restriction": "quantum satis only preserves of red fruit" } ]
[ { "cd": "1001", "description": "The authorization header Is either empty Or isn't Basic" } ]
This is the error code which may be:
This is the description of the error code which may be:
Imports System Imports System.Text imports System.Collections.Generic Imports System.Net Imports Newtonsoft.Json Public Class food_e_additives_recognition_api Public Class ResponseFields Public Property eCode As String Public Property eName As String Public Property categoryNo As String Public Property category As String Public Property restriction As String End Class Public Class ErrorFields Public Property cd As String Public Property description As String End Class Protected Sub SendRequest() Dim Client As WebClient = New WebClient() Dim credentials As String = Convert.ToBase64String(Encoding.ASCII.GetBytes("your_username:your_password")) Client.Headers(HttpRequestHeader.Authorization) = String.Format("Basic {0}", credentials) Client.Headers(HttpRequestHeader.Accept) = "application/json" Client.Headers(HttpRequestHeader.ContentType) = "application/json" Client.BaseAddress = "https://gatiosoft.ro/foodes.aspx" Dim resString As String = "" Try Dim js As String = "Replace this string with your JSON Request Body string like in the example above on the website" Dim reqString As Byte() = Encoding.UTF8.GetBytes(js) Dim url As Uri = New Uri(Client.BaseAddress) Dim resByte As Byte() = Client.UploadData(url, "post", reqString) resString = Encoding.UTF8.GetString(resByte) If resString.IndexOf("eCode") > 0 Then Dim r As ResponseFields = New list (Of ResponseFields() r = JsonConvert.DeserializeObject(Of list (Of ResponseFields))(resString) Console.Write(resString) Else Dim e As list(Of ErrorFields) = New list(Of ErrorFields) e = JsonConvert.DeserializeObject(Of list(Of ErrorFields))(resString) Console.Write(e(0).cd) Console.Write(e(0).description) End If Client.Dispose() Catch exception As Exception Dim ex As System.Exception = exception Console.Write("ERROR: " & resString & ex.Message) End Try End Sub Public Shared Sub Main() Dim b As food-e-additives-recognition_api = New food-e-additives-recognition_api b.SendRequest() End Sub End Class
Sub VBAExcelJson() Url = "https://gatiosoft.ro/foodes.aspx" JsonRequestBody = "Replace this string with your JSON request string like in example above on the website" Dim JsonHttp As Object Set JsonHttp = CreateObject("Microsoft.XMLHTTP") Dim authUser As String authUser = "Your Usernmae" Dim authPass As String authPass = "Your Password" With JsonHttp .Open "POST", Url, False .SetRequestHeader "Authorization", "Basic " + EncodeBase64(authUser + ":" + authPass) .SetRequestHeader "Content_Type", "application/json" .SetRequestHeader "Accept", "application/json" .send (JsonRequestBody) End With Dim JsonResult As String JsonResult = JsonHttp.responseText Cells(1, 1).value = JsonResult End Sub Function EncodeBase64(text As String) As String Dim arrData() As Byte arrData = StrConv(text, vbFromUnicode) Dim objXML As MSXML2.DOMDocument60 Dim objNode As MSXML2.IXMLDOMElement Set objXML = New MSXML2.DOMDocument60 Set objNode = objXML.createElement("b64") objNode.DataType = "bin.base64" objNode.nodeTypedValue = arrData EncodeBase64 = Application.Clean(objNode.text) Set objNode = Nothing Set objXML = Nothing End Function
using System; using System.Collections.Generic; using System.Text; using System.Net; using Newtonsoft.Json; public class food_e_additives_recognition_api { public class ResponseFields { public string eCode { get; set; } public string eName { get; set; } public string categoryNo { get; set; } public string category { get; set; } public string restriction { get; set; } } public class ErrorFields { public string cd { get; set; } public string description { get; set; } } protected void SendRequest() { WebClient Client = new WebClient(); string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes("your_username:your_password")); Client.Headers[HttpRequestHeader.Authorization] = string.Format("Basic {0}", credentials); Client.Headers[HttpRequestHeader.Accept] = "application/json"; Client.Headers[HttpRequestHeader.ContentType] = "application/json"; Client.BaseAddress = "https://gatiosoft.ro/foodes.aspx"; string resString = ""; try { string js = "Replace this string with your JSON Request Body string like in the example above on the website"; byte[] reqString = Encoding.UTF8.GetBytes(js); Uri url = new Uri(Client.BaseAddress); byte[] resByte = Client.UploadData(url, "post", reqString); resString = Encoding.UTF8.GetString(resByte); if (resString.IndexOf("eCode") > 0) { ResponseFields r = new List<ResponseFields>(); r = JsonConvert.DeserializeObject<List<ResponseFields>>(resString); Console.Write(resString); } else { List<ErrorFields> e = new List<ErrorFields>(); e = JsonConvert.DeserializeObject<List<ErrorFields>>(resString); Console.Write(e[0].cd); Console.Write(e[0].description); } Client.Dispose(); } catch (Exception exception) { System.Exception ex = exception; Console.Write("ERROR: " + resString + ex.Message); } } public static void Main() { food_e_additives_recognition_api b = new food_e_additives_recognition_api(); b.SendRequest(); } }
import java.util.Base64; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.ProtocolException; import java.net.URL; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws IOException { String originalInput = "your_username:your_password"; String credentials = Base64.getEncoder().encodeToString(originalInput.getBytes()); final String POST_PARAMS = "Replace this string with your JSON request string"; URL obj = new URL("https://gatiosoft.ro/foodes.aspx"); HttpURLConnection postConnection = (HttpURLConnection) obj.openConnection(); postConnection.setRequestMethod("POST"); postConnection.setRequestProperty("Authorization", "Basic " + credentials); postConnection.setRequestProperty("Content-Type", "application/json"); postConnection.setRequestProperty("Accept", "application/json"); postConnection.setDoOutput(true); OutputStream os = postConnection.getOutputStream(); os.write(POST_PARAMS.getBytes()); os.flush(); os.close(); int responseCode = postConnection.getResponseCode(); if (responseCode == 200) { //success BufferedReader in = new BufferedReader(new InputStreamReader( postConnection.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in .readLine()) != null) { response.append(inputLine); } in .close(); // print json string result System.out.println(response.toString()); } else { System.out.println("POST NOT WORKED"); } } }
<?php ob_start(); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); data_string = 'Replace this string with your JSON request string like in the example above on the website'; $username = 'your_usernmae'; $password = 'your_password'; $hash = base64_encode($username . ':' . $password); $headers = array( 'Authorization: Basic ' . $hash ); ?><!DOCTYPE html> <html lang="en"> <head> <title>Test Food E-Additives Recognition API</title> </head> <body> <?php $url = "https://gatiosoft.ro/foodes.aspx"; // Where you want to post data try { $ch = curl_init(); if (FALSE === $ch) throw new Exception('failed to initialize'); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); // Tell cURL you want to post something curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); // Define what you want to post curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); //curl_setopt(/* ... */); $content = curl_exec($ch); $info = curl_getinfo($ch); if (FALSE === $content) throw new Exception(curl_error($ch), curl_errno($ch)); } catch(Exception $e) { trigger_error(sprintf( 'Curl failed with error #%d: %s', $e->getCode(), $e->getMessage()), E_USER_ERROR); } echo '<pre>'; print_r($data); echo '</pre>'; echo '<br />'; echo http_build_query(array('data' => $data)); echo '<br /><br />'; $json = json_encode($data); echo "<b>JSON Request is:</b>" ."<br />" . $json . "<br />" . "<br />"; $onlyjson = str_replace("\u0022", '"', $content); echo "<br />" . "<br />" . "<b>JSON Response From API is:</b>" . "<br />" . $onlyjson . "<br />";?> </body> </html>
String URL = "https://gatiosoft.ro/foodes.aspx"; String inputs = "Replace this string with your JSON request string"; JSONArray arr = new JSONArray(inputs); JsonArrayRequest req = new JsonArrayRequest(URL, arr, new Response.Listener<JSONArray>() { @Override public void onResponse(JSONArray response) { try { VolleyLog.v("Response:%n %s", response.toString(4)); } catch (JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { VolleyLog.e("Error: ", error.getMessage()); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { String credentials = "username" + ":" + "password"; String base64EncodedCredentials = Base64.encodeToString(credentials.getBytes(), Base64.NO_WRAP); HashMap<String, String> headers = new HashMap<>(); headers.put("Authorization", "Basic " + base64EncodedCredentials); headers.put("Content-Type", "application/json"); headers.put("Accept", "application/json"); return headers; } }; MyApplication.getInstance().addToRequestQueue(req, "headerRequest");
import Foundation import UIKit import Alamofire class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let url = URL(string: "https://gatiosoft.ro/foodes.aspx")! // your credentials encoded in base64 let username = "Your username" let password = "Your password" let loginData = String(format: "%@:%@", username, password). data(using: String.Encoding.utf8)! let base64LoginData = loginData.base64EncodedString() let headers = ["Authorization" : "Basic \(base64LoginData)", "Content-Type": "application/json", "Accept": "application/json"] //Prepare paramsBody to send let paramsBody: [String: Any] = ["Replace this string with your JSON request string"] //Make Request Alamofire.request(url, method: .post,parameters: paramsBody, encoding: URLEncoding.default, headers: headers).responseJSON { response in print(response) //get status code if let status = response.response?.statusCode { switch(status){ case 201: print("Success") default: print("Error with response status: \(status)") } } //get JSON return value if let result = response.result.value { let JSON = result as! NSDictionary print(JSON) } } } }
import requests import json import base64 json_string = 'Replace this string with your JSON request string' data = json.loads(json_string) usrPass = b'your_username:your_password' b64Val = base64.b64encode(usrPass) b64Val = str(b64Val,'utf-8') resp = requests.post('https://gatiosoft.ro/foodes.aspx', headers={"Authorization": "Basic %s" % b64Val, 'Content-Type': 'application/json', 'Accept': 'application/json'}, json=data) resp_data = resp.json() print(resp_data)
require 'uri' require 'net/https' require 'json' require 'base64' class DoHttpsRequest def call(url, json) uri = URI.parse(url) req = Net::HTTP::Post.new(uri.to_s) req.body = json.to_json req['Content-Type'] = 'application/json' req['Accept'] = 'application/json' req['Authorization'] = 'Basic ' + Base64.strict_encode64("your_username:your_password") response = https(uri).request(req) response.body parsed=JSON.parse(response.body) puts parsed["final_photo"] end private def https(uri) Net::HTTP.new(uri.host, uri.port).tap do |http| http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE end end end url = "https://gatiosoft.ro/foodes.aspx" input_json={ "base64ImageString":"NO", "eCode":"E100;E101;E200" } puts DoHttpsRequest.new.call(url, input_json)
var request = require('request'); var auth = 'Basic ' + Buffer.from('your_username' + ':' + 'your_password').toString('base64'); var urlapi = 'https://gatiosoft.ro/foodes.aspx'; request.post({ url: urlapi, headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': auth }, json: { "base64ImageString": "iVBORw...base64 encoded string photo...GSuQmCC", "eCode": "NO" } }, function(error, response, body) { console.log(response) } );
FUNCTION Food_E_Additives_Recognition_API() chttp is un httpRequest creponse is un httpResponse sPassWord is a Buffer = "your_username:your_password" Res_Encode64 is a string = Encode( sPassWord , encodeBASE64) chttp..Header["Authorization"] = "Basic "+ Res_Encode64 chttp..Header["Accept"] = "application/json" chttp..URL = "https://gatiosoft.ro/foodes.aspx" chttp..Method = httpPost chttp..ContentType = "application/json" chttp.Content= [ { "base64ImageString":"iVBORw0KGgoAAAA...base64 encoded string photo...GAAAAAElFTkSuQmCC", "eCode":"NO" } ] chttp.Content=StringToUTF8(chttp.Content) creponse = HTTPSend(chttp) IF ErrorOccurred THEN Error(ErrorInfo(errComplet)) STC_Result..Value="Error" ELSE let vReponseVariant = JSONToVariant("["+creponse.Content+"]") STC_Result..Value=creponse.Content END
<!DOCTYPE html> <html> <head> <title>Food E-Additives Recognition API, FoodEs</title> </head> <body> //Put the script below before the end of body tag. <script> let url = 'https://cors-anywhere.herokuapp.com/https://gatiosoft.ro/foodes.aspx'; let username = 'your_username'; let password = 'your_password'; var data = { "base64ImageString":"iVBOR..base64 encoded string photo...FTkSuQmCC", "eCode":"NO" }; var x = new XMLHttpRequest(); x.open('POST', url); x.setRequestHeader('Authorization', 'Basic ' + window.btoa(username + ":" + password)); x.setRequestHeader('Content-Type', 'application/json'); x.setRequestHeader('Accept', 'application/json'); x.onload = x.onerror = function() { if (x.status==200 && x.statusText=='OK') console.log(x.responseText); else console.log("Error"); }; x.send(JSON.stringify(data)); </script> </body> </html>
Food E-Additives Recognition API, foodes is in the video presentation below. There are several search terms which you may use like: Food E-Additives Recognition sdk, Food E-Additives Detection c#, Food E-Additives Recognition online, automatic Food E-Additives Recognition, Food E-Additives Recognition python, real time Food E-Additives Detection python.
Terms and Conditions | Privacy Policy | Cookies | ANPC | ANSPDCP | Contact