entity.search 메서드

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

HTTP 요청

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

쿼리 매개변수

매개변수 이름 유형 설명
query string 지식 그래프에서 검색할 리터럴 문자열입니다.
ids string 지식 그래프에서 검색할 항목 ID 목록입니다. HTTP 요청에서 여러 ID를 지정하려면 ...?ids=A&ids=B와 같이 URL에서 매개변수를 반복합니다.
languages string 쿼리를 실행할 때 사용할 언어 코드 목록(ISO 639에서 정의됨)입니다(예: `en`).
types string 반환되는 항목을 지정된 유형의 항목으로 제한합니다. 예를 들어 'Person'(http://schema.org/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 어휘와 호환되는 제한된 확장 (예: resultScore)과 함께 schema.org에 호스팅된 어휘를 사용합니다. 이러한 확장에 대한 자세한 내용은 스키마 확장 프로그램 목록을 참조하세요.

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

  • 사람 -> http://schema.org/Person
  • 사물 -> http://schema.org/Thing

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

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

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

  • EntitySearchResult -> http://schema.googleapis.com/EntitySearchResult
  • 세부정보 설명 -> http://schema.googleapis.com/detailedDescription

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

스키마 확장 목록

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

Schema.org의 type 확장은 다음과 같습니다.

Schema.org의 속성 확장은 다음과 같습니다.