entities.search 메서드

제약 조건과 일치하는 항목을 지식 그래프에서 검색합니다.

HTTP 요청

GET https://kgsearch.googleapis.com/v1/entities:search

쿼리 매개변수

매개변수 이름 유형 설명
query string 지식 그래프에서 검색할 리터럴 문자열입니다.
ids string 지식 그래프에서 검색할 항목 ID 목록입니다. HTTP 요청에서 여러 ID를 지정하려면 URL에서 매개변수를 반복하세요(예: ...?ids=A&ids=B).
languages string 쿼리를 실행할 언어 코드 목록입니다 (ISO 639에 정의됨, 예: `en`).
types string 반환된 항목을 지정된 유형으로 제한합니다. 예를 들어 http://schema.org/Person에 정의된 대로 `Person`을 지정하여 결과를 사람을 나타내는 항목으로 제한할 수 있습니다. 여러 유형이 지정된 경우 반환된 항목에는 이러한 유형이 하나 이상 포함됩니다.
indent boolean JSON 결과의 들여쓰기를 사용 설정합니다.
prefix boolean 항목의 이름 및 별칭에 대한 접두사 (초기 하위 문자열) 일치를 사용 설정합니다. 예를 들어 프리픽스 `Jung` 은 `Jung`, `Jungle`, `Jung-ho Kang`과 같은 항목 및 별칭과 일치합니다.
limit number 반환할 항목 수를 제한합니다. 최댓값은 500입니다. 기본값은 20입니다. 한도가 높은 요청은 시간 초과될 가능성이 높습니다.

요청 본문

요청 본문은 비어 있어야 합니다.

응답 본문

응답 메시지에는 JSON-LD 형식으로 표현되고 schema.org 스키마(제한된 외부 확장 프로그램 포함)와 호환되는 항목 목록이 포함됩니다.

다음 JSON-LD 예는 응답 본문의 구조를 보여줍니다.

{
  "@context": {
    "@vocab": "http://schema.org/",
    "goog": "http://schema.googleapis.com/",
    "resultScore": "goog:resultScore",
    "detailedDescription": "goog:detailedDescription",
    "EntitySearchResult": "goog:EntitySearchResult",
    "kg": "http://g.co/kg"
  },
  "@type": "ItemList",
  "itemListElement": [
    {
      "@type": "EntitySearchResult",
      "result": {
        "@id": "kg:/m/0dl567",
        "name": "Taylor Swift",
        "@type": [
          "Thing",
          "Person"
        ],
        "description": "Singer-songwriter",
        "image": {
          "contentUrl": "https://t1.gstatic.com/images?q=tbn:ANd9GcQmVDAhjhWnN2OWys2ZMO3PGAhupp5tN2LwF_BJmiHgi19hf8Ku",
          "url": "https://en.wikipedia.org/wiki/Taylor_Swift",
          "license": "http://creativecommons.org/licenses/by-sa/2.0"
        },
        "detailedDescription": {
          "articleBody": "Taylor Alison Swift is an American singer-songwriter and actress. Raised in Wyomissing, Pennsylvania, she moved to Nashville, Tennessee, at the age of 14 to pursue a career in country music. ",
          "url": "http://en.wikipedia.org/wiki/Taylor_Swift",
          "license": "https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License"
        },
        "url": "http://taylorswift.com/"
      },
      "resultScore": 4850
    }
  ]
}

응답 필드

필드 이름 유형 설명
@id string 항목의 표준 URI입니다.
name string 항목 이름입니다.
@type array 엔티티와 일치하는 지원되는 schema.org 유형의 목록입니다.
description string 엔티티에 대한 간단한 설명입니다.
image URL 엔티티를 식별하는 데 도움이 되는 이미지입니다.
detailedDescription string 엔티티에 대한 자세한 설명입니다.
url URL 항목의 공식 웹사이트 URL입니다(사용 가능한 경우).
resultScore number 엔티티가 요청 제약 조건과 얼마나 잘 일치하는지를 나타내는 지표입니다.

JSON-LD 키워드

@context, @vocab, @type, @id와 같은 JSON-LD 키워드는 JSON-LD 사양을 참고하세요.

Schema.org 호환성

대답에서는 schema.org에 호스팅된 어휘를 사용하며, schema.org 어휘와 호환되는 제한된 확장 프로그램 (예: resultScore)이 있습니다. 이러한 확장 프로그램에 관한 자세한 내용은 스키마 확장 프로그램 목록을 참고하세요.

각 Schema.org 유형 (예: Person) 및 속성 (예: name)에는 다음 예와 같이 해당하는 전체 URI가 있습니다.

  • Person -> http://schema.org/Person
  • Thing -> http://schema.org/Thing

  • name -> http://schema.org/name

  • description -> http://schema.org/description

Google 스키마 확장으로 정의된 유형과 속성은 http://schema.googleapis.com으로 확장할 수 있습니다. 예를 들면 다음과 같습니다.

  • EntitySearchResult -> http://schema.googleapis.com/EntitySearchResult
  • detailedDescription -> http://schema.googleapis.com/detailedDescription

각 유형과 속성에 대한 문서는 해당 URI에서 확인할 수 있습니다.

스키마 확장 프로그램 목록

이 API에서 사용되는 스키마 확장 프로그램은 http://schema.googleapis.com외부 확장 프로그램으로 호스팅됩니다.

Schema.org의 type 확장 프로그램은 다음과 같습니다.

Schema.org의 속성 확장 프로그램은 다음과 같습니다.