This method of the Image Recognition API sends an image recognition request from a client application (such as mobile apps or your own server).
Note that the parameters must use multipart/form-data encoding.
The example uses query image query.jpg, collection token afe34dbe14890fac, App ID com.catchoom.test and SDK version ARSDK-1.
1 |
curl https://search.craftar.net/v2/search -F "token=afe34dbe14890fac" -F "image=@query.jpg" -F "app_id=com.catchoom.test" -F "version=ARSDK-1" |
1 2 |
import catchoom catchoom.search(token="afe34dbe14890fac", filename="query.jpg", app_id="com.catchoom.test", version="ARSDK-1") |
The response contains a JSON dictionary with recognized items (objects) ordered by their scores, i.e. the first item has the highest score.
The JSON dictionary has the following fields:
In case of an error, in addition to an appropriate HTTP status code, the service will also return a much more specific and informative error codes in the JSON response. Check the documentation on Error codes in the recognition API for more detailed information.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
{ "search_time": 95, "collection": { "uuid": "dde84e1e72004808b5b0c490f2e78e23", "pubkey": "-----BEGIN PUBLIC KEY----- ... -----END PUBLIC KEY-----", "image_template": "https://crs-beta-catchoom.s3.amazonaws.com/cache/collections/{0}/images/{1}_{2}_thumb_120.jpe", "app_id": "com.catchoom.test" }, "results":[ { "item":{ "uuid":"b01c52771bd54b5d8e05cd626db99504", "name":"Example Item", "images": [ "83401c67067b4a7cbc3b6addccc9aa79", "233062ceaaaf4e998cc64bf8b8406bac" ], "trackable": true, "url":"http://example/url", "tracking": "<Signed tracking data>", "custom":"https://example.com/custom_data.json" "content": { "contents_v2": [], "version": 2 } }, "image": "83401c67067b4a7cbc3b6addccc9aa79", "score":100, "bbox":[ [0.56, 0.31], [0.73, 0.16], [0.87, 0.51], [1.04, 0.36] ] } ] } |
1 2 3 4 5 6 |
{ "error": { "code": "IMAGE_TOO_LARGE", "message": "Image file size is too large" } } |