How to retrieve a logo in one of your pictures
Usage
Endpoint
[GET | POST] https://api.talkwalker.com/api/v2/detect/images/logo
GET
method used with parameterimage_url
.POST
method used with parameterimage_file
.
Parameters
Due to the large number of logos in the Talkwalker system, it’s not allowed to perform the detection on all logos. First, the list of logos you’re interested in must be configured on the Talkwalker side.
Name | Description | Mandatory |
---|---|---|
access_token | Access_token provided by Talkwalker to use APIs. It is the same as the search API. | Yes |
image_url | URL where to download the image. | No |
image_file | Filename of the image to be past as multipart/form-data | No |
detect | List of logo IDs to detect in the image. IDs are separated by a comma character. If not set, the detection will be done on all IDs configured for your account. | No |
Important
At least one of these 2 parameters is required: image_url
or image_file
.
Sample by URL
In this sample, we will detect the logos of BMW and AUDI from this picture
URL: https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/AUDI_A6L_C8_China_%287%29.jpg/640px-AUDI_A6L_C8_China_%287%29.jpg
Request
curl -X GET 'https://api.talkwalker.com/api/v2/detect/images/logo?access_token=<access_token>&image_url=https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/AUDI_A6L_C8_China_%287%29.jpg/640px-AUDI_A6L_C8_China_%287%29.jpg&detect=audi,bmw'
Result
{
"status_code": "0",
"status_message": "OK",
"request": "GET /api/v2/detect/images/logo?image_url=https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/AUDI_A6L_C8_China_%287%29.jpg/640px-AUDI_A6L_C8_China_%287%29.jpg&detect=audi,bmw&access_token=***",
"result_processing": {
"match": [
{
"top": 197,
"left": 317,
"right": 379,
"bottom": 220,
"confidence": 0.9940353631973267,
"id": "audi"
}
],
"height": 395,
"width": 640
},
"request_id": "#rlpe7bonvpbd#"
}
Sample by file upload
In this sample, we will try to detect all logos from our configuration (3 are configured: Tesla, BMW and Audi), so we will not use the parameter detect.
Request executed on this picture:
Request
curl -X POST 'https://api.talkwalker.com/api/v2/detect/images/logo?access_token=<access_token>' -F 'image_file=@"/C:/Users/p.gouttebel/OneDrive/Pictures/logo-marque-voiture-905x509.jpg"'
Result
{
"status_code": "0",
"status_message": "OK",
"request": "POST /api/v2/detect/images/logo?access_token=***",
"result_processing": {
"match": [
{
"top": 93,
"left": 161,
"right": 246,
"bottom": 142,
"confidence": 0.883729875087738,
"id": "audi"
},
{
"top": 80,
"left": 77,
"right": 155,
"bottom": 138,
"confidence": 0.7784143686294556,
"id": "bmw"
}
],
"height": 509,
"width": 905
},
"request_id": "#rlpedv8apdpv#"
}