Get asset search result

Prev Next

Available in VPC

Get the asset search result. After calling the Request asset search, you can use the issued searchId to view the results.

Note
  • totalCount and results are returned only if status is in the "COMPLETED" status.
  • It is sorted by query score, followed by index creation.

Request

This section describes the request format. The method and URI are as follows:

Method URI
GET /api/v1/workspaces/{workspace_name}/assets/search/{search_id}

Request headers

For information about the headers common to all Media Intelligence APIs, see Media Intelligence request headers.

Request path parameters

You can use the following path parameters with your request:

Field Type Required Description
workspace_name String Required Workspace name
search_id String Required Search identifier issued when requesting asset search

Request query parameters

You can use the following query parameters with your request:

Field Type Required Description
pageSize Integer Optional Number of results per page
  • 1-100 (default: 50)
pageNum Integer Optional Page number to query
  • 1-N (default: 1)

Request example

The request example is as follows:

curl --location --request GET 'https://mi.apigw.ntruss.com/api/v1/workspaces/betatest/scene-search/JtWJKTDCKknMHP8Id4Gt?pageSize=50&pageNum=1' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'

Response

This section describes the response format.

Response body

The response body includes the following data:

Field Type Required Description
code String - API processing result code
message String - API processing result message
result Object - Asset search result information
result.searchId String - Search identifier issued when requesting asset search
result.status String - Search status code
  • RUNNING | COMPLETED | FAILED
    • RUNNING: Searching
    • COMPLETED: Completed
    • FAILED: Failed
result.totalCount Integer - Total number of assets searched
  • Included if status is COMPLETED
result.totalPage Integer - Total page count
  • Included if status is COMPLETED
result.pageNo Integer - Current page number
  • Included if status is COMPLETED
result.pageSize Integer - Number of results per page
  • Included if status is COMPLETED
result.content Array - Scene/image-level search result list: content
  • Included if status is COMPLETED

content

The following describes content.

Field Type Required Description
jobId Integer - Search target index (job) ID
engine String - Index engine version
type String - Asset type
  • IMAGE | VIDEO
    • IMAGE: Image
    • VIDEO: Video
assetId Integer - Search target media asset ID
assetName String - Asset name
scene Integer - Asset ID searched in the video
  • Image assets are displayed as 0.
score Number - Asset similarity score
startMs Number - Video asset start time (millisecond)
  • Image assets are displayed as 0.
endMs Number - Video asset end time (millisecond)
  • Image assets are displayed as 0.
assetUrl String - Media URL
  • (Valid for 1 hour)
sceneThumbnailUrl String - (During video analysis) Scene thumbnail image URL
  • (Valid for 1 hour)
shots Array - List of shot information included in the asset: shots

shots

The following describes shots.

Field Type Required Description
shot Integer - Shot ID
  • Image assets are displayed as 0.
startMs Number - Shot start time (millisecond)
  • Image assets are displayed as 0.
endMs Number - Shot end time (millisecond)
  • Image assets are displayed as 0.
score Number - Shot similarity score
persons Array - List of people in the shot: persons
scripts Array - List of dialogues included in the shot: scripts
queryRef Array - List of matching information with user query: queryRef

persons

The following describes persons.

Field Type Required Description
personId Integer - Person ID
name String - Person name
profileUrl String - Person thumbnail image URL
  • (Valid for 1 hour)

scripts

The following describes scripts.

Field Type Required Description
startMs Number - Dialogue start time (millisecond)
endMs Number - Dialogue end time (millisecond)
text String - Dialogue text
name String - Speaker name
  • If anonymous, displayed as Speaker 1, Speaker 2, etc.
personId Integer - Speaker person ID
  • Null if anonymous

queryRef

The following describes queryRef.

Field Type Required Description
queryType String - Query type
  • TEXT | IMAGE | PERSON | DIALOGUE
    • TEXT: Text search result
    • IMAGE: Image search result
    • PERSON: Person search result
    • DIALOGUE: Dialogue search result
conditionType String - Query condition
  • MUST | ANY
matchedValues Array[String] - Matching values of the entered query with the corresponding shot

Response example

The response example is as follows:

{
  "code": "0",
  "message": "success",
  "result": {
    "search_id": "JtWJKTDCKknMHP8Id4Gt",
    "status": "COMPLETED",
    "totalCount": 1,
    "totalPage": 1,
    "pageNo": 1,
    "pageSize": 50,
    "content": [
      {
        "jobId": 12345,
        "engine": "v2.1.0",
        "type":"VIDEO",
        "assetId": 67890,
        "assetName": "Urban chase",
        "scene": 7,
        "score": 98.3,
        "startMs": 120000,
        "endMs": 135000,
        "assetUrl": "https://kr.object.ncloudstorage.com/.../12345/video.mp4?X-Amz-...",
        "sceneThumbnailUrl": "https://kr.object.ncloudstorage.com/.../12345/7.jpg?X-Amz-...",
        "shots": [
          {
            "shot": 70,
            "startMs": 121000,
            "endMs": 123000,
            "score": 98.3,
            "persons": [
              {
                "personId": 1001,
                "name": "Jae-suk Yoo",
                "profileUrl": "https://kr.object.ncloudstorage.com/.../jiho0.jpg?X-Amz-..."
              }
            ],
            "scripts": [
              {
                "startMs": 121500,
                "endMs": 122000,
                "text": "This way, come on!",
                "name": "Speaker 1",
                "personId": null
              }
            ],
            "queryRef": [
              {
                "queryType": "TEXT",
                "conditionType": "MUST",
                "matchedValues": ["Dark alley"]
              }
            ]
          },
          {
            "shot": 71,
            "startMs": 123000,
            "endMs": 125000,
            "score": 95.8,
            "persons": [
              {
                "personId": 1001,
                "name": "Jae-suk Yoo",
                "profileUrl": "https://kr.object.ncloudstorage.com/.../jiho0.jpg?X-Amz-..."
              }
            ],
            "scripts": [
              {
                "startMs": 124000,
                "endMs": 124500,
                "text": "Danger, hide!",
                "name": "Speaker 2",
                "personId": 1001
              }
            ],
            "queryRef": [
              {
                "queryType": "DIALOGUE",
                "conditionType": "ANY",
                "matchedValues": ["Danger"]
              }
            ]
          }
        ]
      }
    ]
  }
}