How to retrieve Talkwalker scene code in one of your pictures
List of scene codes
Full list is available here.
Usage
Endpoint
[GET | POST] https://api.talkwalker.com/api/v2/detect/images/scene
GET
method used with parameterimage_url
.POST
method used with parameterimage_file
.
Parameters
The parameter detect is not taken into consideration and all results are returned in the API response.
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 |
Important
At least one of these 2 parameters is required: image_url
or image_file
.
Sample by URL
In this sample, we detect the scene where the picture was extracted:
Request
curl -X GET 'https://api.talkwalker.com/api/v2/detect/images/scene?access_token=<access_token>&image_url=https://upload.wikimedia.org/wikipedia/commons/thumb/2/23/Schiphol_Departures3.jpg/1280px-Schiphol_Departures3.jpg'
Result
{
"status_code": "0",
"status_message": "OK",
"request": "GET /api/v2/detect/images/scene?access_token=***&image_url=https://upload.wikimedia.org/wikipedia/commons/thumb/2/23/Schiphol_Departures3.jpg/1280px-Schiphol_Departures3.jpg",
"result_processing": {
"match": [
{
"top": 0,
"left": 0,
"right": 0,
"bottom": 0,
"confidence": 1.0,
"id": "scene-airport_terminal"
},
{
"top": 0,
"left": 0,
"right": 0,
"bottom": 0,
"confidence": 0.9958305954933167,
"id": "scene-indoor"
}
],
"height": 960,
"width": 1280
},
"request_id": "#qz64qko5jb5v#"
}
Sample by file upload
In this sample, we detect the scene where the picture was extracted:
Request
curl -X POST 'https://api.talkwalker.com/api/v2/detect/images/scene?access_token=<access_token>' -F 'image_file=@"/C:/Users/p.gouttebel/OneDrive/Pictures/5c9315552a0000ba024e406f.jpeg"'
Result
{
"status_code": "0",
"status_message": "OK",
"request": "POST /api/v2/detect/images/scene?access_token=***",
"result_processing": {
"match": [
{
"top": 0,
"left": 0,
"right": 0,
"bottom": 0,
"confidence": 0.9999403953552246,
"id": "scene-bar"
},
{
"top": 0,
"left": 0,
"right": 0,
"bottom": 0,
"confidence": 0.9991461038589478,
"id": "scene-indoor"
}
],
"height": 998,
"width": 1778
},
"request_id": "#qz64y2pnt1ws#"
}