Knowledge Graph API (Preview) - V5

The Bing Knowledge Graph API detects things of interest (entities) in text and augments the entities with rich facts, relationships, and images.

Knowledge

Detects and augments entities for a given query.

Try it

Request URL

Request parameters

string

Query

(optional)
string

A boolean indicating if you want to detect entities in your query and return matched entities and their offset within the query

Request headers

string
Subscription key which provides access to this API. Found in your Profile.

Request body

Response 200

{
    "_type": "SearchResponse",
    "queryContext": {
        "originalQuery": "tom hanks",
        "isLocationImplied": false
    },
    "entities": {
        "id": "https://www.bingapis.com/api/v5/#Entities",
        "queryScenario": "DominantEntity",
        "value": [{
            "id": "47548b76-d91c-5710-e5b2-2c9d709a3be9",
            "readLink": "https://www.bingapis.com/api/v5/search?q=Tom+Hanks&filters=sid:%2247548b76-d91c-5710-e5b2-2c9d709a3be9%22&responsesize=m&knowledge=1",
            "name": "Tom Hanks",
            "image": {
                "name": "“Oprah Winfrey today you are surrounded by nothing but love.”",
                "thumbnailUrl": "https://www.bing.com/th?id=Aa3ba0d211390f39bd8e983abb1a158f0&c=12&rs=1&qlt=80&cdv=1&pid=16.2",
                "provider": [{
                    "_type": "Organization",
                    "url": "http://en.wikipedia.org/wiki/Tom_Hanks"
                }],
                "width": 100,
                "height": 100
            },
            "description": "Thomas Jeffrey \"Tom\" Hanks is an American actor and filmmaker. He is known for his roles in Splash, Big, Turner & Hooch, Philadelphia, Forrest Gump, Apollo 13, Saving Private Ryan, You've Got Mail, The Green Mile, Cast Away, The Da Vinci Code, Captain Phillips, and Saving Mr. Banks, as well as …",
            "webSearchUrl": "https://www.bing.com/search?q=tom+hanks&filters=ufn%3a%22tom+hanks%22+sid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9%22&FORM=SNAPST&location=lat:47.6812;long:-122.1207;disp:Redmond%2C%20Washington;",
            "entityPresentationInfo": {
                "entityScenario": "DominantEntity",
                "entityTypeHints": [
                    "Actor"
                ],
                "formattedFacts": [{
                    "label": "Born",
                    "items": [{
                        "text": "Jul 09, 1956 (age 60)"
                    }]
                }, {
                    "label": "Net worth",
                    "items": [{
                        "text": "$350 million USD (2016)"
                    }]
                }, {
                    "label": "Spouse",
                    "items": [{
                        "_type": "Properties/Link",
                        "text": "Rita Wilson",
                        "url": "https://www.bing.com/search?q=rita+wilson&filters=ufn%3a%22rita+wilson%22+sid%3a%224bb0400d-795c-35a4-a89a-24abe38260ef%22&FORM=SNAPST"
                    }, {
                        "_type": "Properties/Space",
                        "text": " "
                    }, {
                        "text": "(m. 1988)"
                    }, {
                        "_type": "Properties/Separator",
                        "text": " · "
                    }, {
                        "_type": "Properties/Link",
                        "text": "Samantha Lewes",
                        "url": "https://www.bing.com/search?q=samantha+lewes&filters=ufn%3a%22samantha+lewes%22+sid%3a%22d0ede8fc-c47d-0eca-7e0f-5c49331c2b1c%22&FORM=SNAPST"
                    }, {
                        "_type": "Properties/Space",
                        "text": " "
                    }, {
                        "text": "(m. 1978 - 1987)"
                    }]
                }, {
                    "label": "Children",
                    "items": [{
                        "_type": "Properties/Link",
                        "text": "Colin Hanks",
                        "url": "https://www.bing.com/search?q=colin+hanks&filters=ufn%3a%22colin+hanks%22+sid%3a%229d661e7b-3659-9d5e-321d-76d7718768b5%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_2e510106%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                    }, {
                        "_type": "Properties/Space",
                        "text": " "
                    }, {
                        "text": "(Son)"
                    }, {
                        "_type": "Properties/Separator",
                        "text": " · "
                    }, {
                        "_type": "Properties/Link",
                        "text": "Elizabeth Hanks",
                        "url": "https://www.bing.com/search?q=elizabeth+ann+hanks&filters=ufn%3a%22elizabeth+ann+hanks%22+sid%3a%223ad0f893-6f07-377d-f0bf-57f75e091536%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_2e510106%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                    }, {
                        "_type": "Properties/Space",
                        "text": " "
                    }, {
                        "text": "(Daughter)"
                    }, {
                        "_type": "Properties/Separator",
                        "text": " · "
                    }, {
                        "_type": "Properties/Link",
                        "text": "Chet Hanks",
                        "url": "https://www.bing.com/search?q=chet+hanks&filters=ufn%3a%22chet+hanks%22+sid%3a%22ed605c4b-f6d1-b1fb-fc8b-4e7e55beb184%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_2e510106%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                    }, {
                        "_type": "Properties/Space",
                        "text": " "
                    }, {
                        "text": "(Son)"
                    }, {
                        "_type": "Properties/Separator",
                        "text": " · "
                    }, {
                        "_type": "Properties/Link",
                        "text": "Truman Theodore Hanks",
                        "url": "https://www.bing.com/search?q=truman+theodore+hanks&filters=ufn%3a%22truman+theodore+hanks%22+sid%3a%22f3104334-f343-8a7a-b945-25657ec29398%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_2e510106%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                    }, {
                        "_type": "Properties/Space",
                        "text": " "
                    }, {
                        "text": "(Son)"
                    }]
                }, {
                    "label": "Upcoming movies",
                    "items": [{
                        "_type": "Properties/Link",
                        "text": "Inferno",
                        "url": "https://www.bing.com/search?q=inferno+2016&filters=ufn%3a%22inferno+2016%22+sid%3a%2250560baf-4ed8-4643-8917-7b3c535a4b6b%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_fd929723%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                    }, {
                        "_type": "Properties/Separator",
                        "text": " · "
                    }, {
                        "_type": "Properties/Link",
                        "text": "Toy Story 4",
                        "url": "https://www.bing.com/search?q=toy+story+4+2018&filters=ufn%3a%22toy+story+4+2018%22+sid%3a%225b077df7-5168-e7dd-d25e-856af0214d94%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_fd929723%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                    }]
                }, {
                    "label": "Parents",
                    "items": [{
                        "_type": "Properties/Link",
                        "text": "Janet Marylyn Frager",
                        "url": "https://www.bing.com/search?q=janet+marylyn+frager&filters=ufn%3a%22janet+marylyn+frager%22+sid%3a%2271fdedaf-aee7-843c-0289-63e246a4aad8%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_2c4b9271%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                    }, {
                        "_type": "Properties/Space",
                        "text": " "
                    }, {
                        "text": "(Mother)"
                    }, {
                        "_type": "Properties/Separator",
                        "text": " · "
                    }, {
                        "_type": "Properties/Link",
                        "text": "Amos Mefford Hanks",
                        "url": "https://www.bing.com/search?q=amos+mefford+hanks&filters=ufn%3a%22amos+mefford+hanks%22+sid%3a%22fd678106-ffa1-2316-aacc-946ccc97b5bf%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_2c4b9271%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                    }, {
                        "_type": "Properties/Space",
                        "text": " "
                    }, {
                        "text": "(Father)"
                    }]
                }],
                "attributions": [{
                    "provider": {
                        "name": "Wikipedia",
                        "url": "http://en.wikipedia.org/wiki/Tom_Hanks"
                    }
                }, {
                    "provider": {
                        "name": "IMDb",
                        "url": "http://www.imdb.com/name/nm0000158/"
                    }
                }, {
                    "provider": {
                        "name": "Geni",
                        "url": "https://www.geni.com/people/Tom-Hanks/6000000005393944335"
                    }
                }, {
                    "provider": {
                        "name": "Celebheights",
                        "url": "http://www.celebheights.org/tom-hanks-height/"
                    }
                }, {
                    "provider": {
                        "name": "Freebase",
                        "url": "http://www.freebase.com/"
                    }
                }],
                "related": [{
                    "displayName": "Movies and TV shows",
                    "id": "MoviesAndTVShows",
                    "webSearchUrl": "https://www.bing.com/search?q=tom+hanks+movies+and+tv+shows&filters=ufn%3a%22tom+hanks%22+sid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_df879f25%22+segment%3a%22generic.carousel%22+entitysegment%3a%22Movie%22&FORM=SNAPST",
                    "relationships": [{
                        "relatedThing": {
                            "id": "44d5923e-69be-25e1-f2de-19be76cb82ec",
                            "readLink": "https://www.bingapis.com/api/v5/search?q=Sully&filters=sid:%2244d5923e-69be-25e1-f2de-19be76cb82ec%22&responsesize=m&knowledge=1",
                            "name": "Sully",
                            "url": "https://www.bing.com/search?q=sully+2016+movie&filters=ufn%3a%22sully+2016%22+sid%3a%2244d5923e-69be-25e1-f2de-19be76cb82ec%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_df879f25%22+segment%3a%22generic.carousel%22&FORM=SNAPST",
                            "image": {
                                "name": "Sully",
                                "thumbnailUrl": "https://www.bing.com/th?id=Ae0cb31ac0d955e42bc3a267cc495a72c&c=7&rs=1&qlt=80&cdv=1&pid=16.1",
                                "width": 72,
                                "height": 106
                            },
                            "webSearchUrl": "https://www.bing.com/search?q=Sully&filters=sid:%2244d5923e-69be-25e1-f2de-19be76cb82ec%22&location=lat:47.6812;long:-122.1207;disp:Redmond%2C%20Washington;",
                            "contractualRules": [{
                                "_type": "ContractualRules/MediaAttribution",
                                "targetPropertyName": "image",
                                "url": "https://www.bing.com/search?q=sully+2016+movie&filters=ufn%3a%22sully+2016%22+sid%3a%2244d5923e-69be-25e1-f2de-19be76cb82ec%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_df879f25%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                            }]
                        }
                    }, {
                        "relatedThing": {
                            "id": "17715a08-a91e-b11d-1c3a-e6b7070303f9",
                            "readLink": "https://www.bingapis.com/api/v5/search?q=Ithaca&filters=sid:%2217715a08-a91e-b11d-1c3a-e6b7070303f9%22&responsesize=m&knowledge=1",
                            "name": "Ithaca",
                            "url": "https://www.bing.com/search?q=ithaca+2015+movie&filters=ufn%3a%22ithaca+2015%22+sid%3a%2217715a08-a91e-b11d-1c3a-e6b7070303f9%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_df879f25%22+segment%3a%22generic.carousel%22&FORM=SNAPST",
                            "image": {
                                "name": "Ithaca",
                                "thumbnailUrl": "https://www.bing.com/th?id=Afcab15cc3aa53b6e2976102f5a3bab4a&c=7&rs=1&qlt=80&cdv=1&pid=16.1",
                                "width": 72,
                                "height": 106
                            },
                            "webSearchUrl": "https://www.bing.com/search?q=Ithaca&filters=sid:%2217715a08-a91e-b11d-1c3a-e6b7070303f9%22&location=lat:47.6812;long:-122.1207;disp:Redmond%2C%20Washington;",
                            "contractualRules": [{
                                "_type": "ContractualRules/MediaAttribution",
                                "targetPropertyName": "image",
                                "url": "https://www.bing.com/search?q=ithaca+2015+movie&filters=ufn%3a%22ithaca+2015%22+sid%3a%2217715a08-a91e-b11d-1c3a-e6b7070303f9%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_df879f25%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                            }]
                        }
                    }, {
                        "relatedThing": {
                            "id": "50560baf-4ed8-4643-8917-7b3c535a4b6b",
                            "readLink": "https://www.bingapis.com/api/v5/search?q=Inferno&filters=sid:%2250560baf-4ed8-4643-8917-7b3c535a4b6b%22&responsesize=m&knowledge=1",
                            "name": "Inferno",
                            "url": "https://www.bing.com/search?q=inferno+2016+movie&filters=ufn%3a%22inferno+2016%22+sid%3a%2250560baf-4ed8-4643-8917-7b3c535a4b6b%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_df879f25%22+segment%3a%22generic.carousel%22&FORM=SNAPST",
                            "image": {
                                "name": "Inferno",
                                "thumbnailUrl": "https://www.bing.com/th?id=A6323e54e7c0270338d5d822ff520edd0&c=7&rs=1&qlt=80&cdv=1&pid=16.1",
                                "width": 72,
                                "height": 106
                            },
                            "webSearchUrl": "https://www.bing.com/search?q=Inferno&filters=sid:%2250560baf-4ed8-4643-8917-7b3c535a4b6b%22&location=lat:47.6812;long:-122.1207;disp:Redmond%2C%20Washington;",
                            "contractualRules": [{
                                "_type": "ContractualRules/MediaAttribution",
                                "targetPropertyName": "image",
                                "url": "https://www.bing.com/search?q=inferno+2016+movie&filters=ufn%3a%22inferno+2016%22+sid%3a%2250560baf-4ed8-4643-8917-7b3c535a4b6b%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_df879f25%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                            }]
                        }
                    }, {
                        "relatedThing": {
                            "id": "92e10b85-9ff4-a28e-4b05-80744b6e6319",
                            "readLink": "https://www.bingapis.com/api/v5/search?q=A+Hologram+for+the+King&filters=sid:%2292e10b85-9ff4-a28e-4b05-80744b6e6319%22&responsesize=m&knowledge=1",
                            "name": "A Hologram for the King",
                            "url": "https://www.bing.com/search?q=a+hologram+for+the+king+2016&filters=ufn%3a%22a+hologram+for+the+king+2016%22+sid%3a%2292e10b85-9ff4-a28e-4b05-80744b6e6319%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_df879f25%22+segment%3a%22generic.carousel%22&FORM=SNAPST",
                            "image": {
                                "name": "A Hologram for the King",
                                "thumbnailUrl": "https://www.bing.com/th?id=A43cd82a868114c66f9735e06f48db346&c=7&rs=1&qlt=80&cdv=1&pid=16.1",
                                "width": 72,
                                "height": 106
                            },
                            "webSearchUrl": "https://www.bing.com/search?q=A+Hologram+for+the+King&filters=sid:%2292e10b85-9ff4-a28e-4b05-80744b6e6319%22&location=lat:47.6812;long:-122.1207;disp:Redmond%2C%20Washington;",
                            "contractualRules": [{
                                "_type": "ContractualRules/MediaAttribution",
                                "targetPropertyName": "image",
                                "url": "https://www.bing.com/search?q=a+hologram+for+the+king+2016&filters=ufn%3a%22a+hologram+for+the+king+2016%22+sid%3a%2292e10b85-9ff4-a28e-4b05-80744b6e6319%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_df879f25%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                            }]
                        }
                    }, {
                        "relatedThing": {
                            "id": "b3226796-ce0e-1c46-8aec-b2b70ed5e8c6",
                            "readLink": "https://www.bingapis.com/api/v5/search?q=Bridge+of+Spies&filters=sid:%22b3226796-ce0e-1c46-8aec-b2b70ed5e8c6%22&responsesize=m&knowledge=1",
                            "name": "Bridge of Spies",
                            "url": "https://www.bing.com/search?q=bridge+of+spies+2015+movie&filters=ufn%3a%22bridge+of+spies+2015%22+sid%3a%22b3226796-ce0e-1c46-8aec-b2b70ed5e8c6%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_df879f25%22+segment%3a%22generic.carousel%22&FORM=SNAPST",
                            "image": {
                                "name": "Bridge of Spies",
                                "thumbnailUrl": "https://www.bing.com/th?id=A89163fef702bfed2ae1f2ab086d341af&c=7&rs=1&qlt=80&cdv=1&pid=16.1",
                                "width": 72,
                                "height": 106
                            },
                            "webSearchUrl": "https://www.bing.com/search?q=Bridge+of+Spies&filters=sid:%22b3226796-ce0e-1c46-8aec-b2b70ed5e8c6%22&location=lat:47.6812;long:-122.1207;disp:Redmond%2C%20Washington;",
                            "contractualRules": [{
                                "_type": "ContractualRules/MediaAttribution",
                                "targetPropertyName": "image",
                                "url": "https://www.bing.com/search?q=bridge+of+spies+2015+movie&filters=ufn%3a%22bridge+of+spies+2015%22+sid%3a%22b3226796-ce0e-1c46-8aec-b2b70ed5e8c6%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_df879f25%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                            }]
                        }
                    }]
                }, {
                    "displayName": "People also search for",
                    "id": "PeopleAlsoSearchFor",
                    "webSearchUrl": "https://www.bing.com/search?q=tom+hanks&filters=ufn%3a%22tom+hanks%22+sid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_cfb02057%22+segment%3a%22generic.carousel%22+entitysegment%3a%22Actor%22&FORM=SNAPST",
                    "relationships": [{
                        "relatedThing": {
                            "id": "4bb0400d-795c-35a4-a89a-24abe38260ef",
                            "readLink": "https://www.bingapis.com/api/v5/search?q=Rita+Wilson&filters=sid:%224bb0400d-795c-35a4-a89a-24abe38260ef%22&responsesize=m&knowledge=1",
                            "name": "Rita Wilson",
                            "url": "https://www.bing.com/search?q=rita+wilson&filters=ufn%3a%22rita+wilson%22+sid%3a%224bb0400d-795c-35a4-a89a-24abe38260ef%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_cfb02057%22+segment%3a%22generic.carousel%22&FORM=SNAPST",
                            "image": {
                                "name": "Rita Wilson and Tom Hanks have been married for 28 years since 1988.",
                                "thumbnailUrl": "https://www.bing.com/th?id=Ac77ec7647a33b1732b8625f49424f8dc&c=12&rs=1&qlt=80&cdv=1&pid=16.2",
                                "width": 72,
                                "height": 72
                            },
                            "webSearchUrl": "https://www.bing.com/search?q=Rita+Wilson&filters=sid:%224bb0400d-795c-35a4-a89a-24abe38260ef%22&location=lat:47.6812;long:-122.1207;disp:Redmond%2C%20Washington;",
                            "contractualRules": [{
                                "_type": "ContractualRules/MediaAttribution",
                                "targetPropertyName": "image",
                                "url": "https://www.bing.com/search?q=rita+wilson&filters=ufn%3a%22rita+wilson%22+sid%3a%224bb0400d-795c-35a4-a89a-24abe38260ef%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_cfb02057%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                            }]
                        },
                        "description": "Rita Wilson and Tom Hanks have been married for 28 years since 1988.",
                        "contractualRules": [{
                            "_type": "ContractualRules/LinkAttribution",
                            "targetPropertyName": "description",
                            "mustBeCloseToContent": true,
                            "text": "Text under CC-BY-SA license",
                            "url": "http://creativecommons.org/licenses/by-sa/3.0/"
                        }, {
                            "_type": "ContractualRules/LinkAttribution",
                            "targetPropertyName": "description",
                            "mustBeCloseToContent": true,
                            "text": "Wikipedia",
                            "url": "https://en.wikipedia.org/"
                        }]
                    }, {
                        "relatedThing": {
                            "id": "fdc9ba0e-f198-b3c3-3cad-cf81595a654c",
                            "readLink": "https://www.bingapis.com/api/v5/search?q=Tom+Cruise&filters=sid:%22fdc9ba0e-f198-b3c3-3cad-cf81595a654c%22&responsesize=m&knowledge=1",
                            "name": "Tom Cruise",
                            "url": "https://www.bing.com/search?q=tom+cruise&filters=ufn%3a%22tom+cruise%22+sid%3a%22fdc9ba0e-f198-b3c3-3cad-cf81595a654c%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_cfb02057%22+segment%3a%22generic.carousel%22&FORM=SNAPST",
                            "image": {
                                "name": "Tom Cruise and Tom Hanks are both Golden Globe Award winners.",
                                "thumbnailUrl": "https://www.bing.com/th?id=Acf56e67b7cc2c2cbff9de810b1c93e0c&c=12&rs=1&qlt=80&cdv=1&pid=16.2",
                                "width": 72,
                                "height": 72
                            },
                            "webSearchUrl": "https://www.bing.com/search?q=Tom+Cruise&filters=sid:%22fdc9ba0e-f198-b3c3-3cad-cf81595a654c%22&location=lat:47.6812;long:-122.1207;disp:Redmond%2C%20Washington;",
                            "contractualRules": [{
                                "_type": "ContractualRules/MediaAttribution",
                                "targetPropertyName": "image",
                                "url": "https://www.bing.com/search?q=tom+cruise&filters=ufn%3a%22tom+cruise%22+sid%3a%22fdc9ba0e-f198-b3c3-3cad-cf81595a654c%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_cfb02057%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                            }]
                        },
                        "description": "Tom Cruise and Tom Hanks are both Golden Globe Award winners.",
                        "contractualRules": [{
                            "_type": "ContractualRules/LinkAttribution",
                            "targetPropertyName": "description",
                            "mustBeCloseToContent": true,
                            "text": "Text under CC-BY-SA license",
                            "url": "http://creativecommons.org/licenses/by-sa/3.0/"
                        }, {
                            "_type": "ContractualRules/LinkAttribution",
                            "targetPropertyName": "description",
                            "mustBeCloseToContent": true,
                            "text": "Wikipedia",
                            "url": "https://en.wikipedia.org/"
                        }]
                    }, {
                        "relatedThing": {
                            "id": "5f2c4ac2-d77a-474e-4580-c76549d4fce5",
                            "readLink": "https://www.bingapis.com/api/v5/search?q=Leonardo+DiCaprio&filters=sid:%225f2c4ac2-d77a-474e-4580-c76549d4fce5%22&responsesize=m&knowledge=1",
                            "name": "Leonardo DiCaprio",
                            "url": "https://www.bing.com/search?q=leonardo+dicaprio&filters=ufn%3a%22leonardo+dicaprio%22+sid%3a%225f2c4ac2-d77a-474e-4580-c76549d4fce5%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_cfb02057%22+segment%3a%22generic.carousel%22&FORM=SNAPST",
                            "image": {
                                "name": "Leonardo DiCaprio and Tom Hanks both appear in Catch Me If You Can.",
                                "thumbnailUrl": "https://www.bing.com/th?id=A8a236ec4ef6c8be18e7cdb72a51db309&c=12&rs=1&qlt=80&cdv=1&pid=16.2",
                                "width": 72,
                                "height": 72
                            },
                            "webSearchUrl": "https://www.bing.com/search?q=Leonardo+DiCaprio&filters=sid:%225f2c4ac2-d77a-474e-4580-c76549d4fce5%22&location=lat:47.6812;long:-122.1207;disp:Redmond%2C%20Washington;",
                            "contractualRules": [{
                                "_type": "ContractualRules/MediaAttribution",
                                "targetPropertyName": "image",
                                "url": "https://www.bing.com/search?q=leonardo+dicaprio&filters=ufn%3a%22leonardo+dicaprio%22+sid%3a%225f2c4ac2-d77a-474e-4580-c76549d4fce5%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_cfb02057%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                            }]
                        },
                        "description": "Leonardo DiCaprio and Tom Hanks both appear in Catch Me If You Can.",
                        "contractualRules": [{
                            "_type": "ContractualRules/LinkAttribution",
                            "targetPropertyName": "description",
                            "mustBeCloseToContent": true,
                            "text": "Text under CC-BY-SA license",
                            "url": "http://creativecommons.org/licenses/by-sa/3.0/"
                        }, {
                            "_type": "ContractualRules/LinkAttribution",
                            "targetPropertyName": "description",
                            "mustBeCloseToContent": true,
                            "text": "Wikipedia",
                            "url": "https://en.wikipedia.org/"
                        }]
                    }, {
                        "relatedThing": {
                            "id": "c1595955-d13e-0209-a3fc-8dd4f4f39e0d",
                            "readLink": "https://www.bingapis.com/api/v5/search?q=Chesley+Sullenberger&filters=sid:%22c1595955-d13e-0209-a3fc-8dd4f4f39e0d%22&responsesize=m&knowledge=1",
                            "name": "Chesley Sullenberger",
                            "url": "https://www.bing.com/search?q=sullenberger&filters=ufn%3a%22sullenberger%22+sid%3a%22c1595955-d13e-0209-a3fc-8dd4f4f39e0d%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_cfb02057%22+segment%3a%22generic.carousel%22&FORM=SNAPST",
                            "image": {
                                "name": "Chesley Sullenberger",
                                "thumbnailUrl": "https://www.bing.com/th?id=Aa6d6a813cefe3fb9309dcf475ec99dc5&c=12&rs=1&qlt=80&cdv=1&pid=16.2",
                                "width": 72,
                                "height": 72
                            },
                            "webSearchUrl": "https://www.bing.com/search?q=Chesley+Sullenberger&filters=sid:%22c1595955-d13e-0209-a3fc-8dd4f4f39e0d%22&location=lat:47.6812;long:-122.1207;disp:Redmond%2C%20Washington;",
                            "contractualRules": [{
                                "_type": "ContractualRules/MediaAttribution",
                                "targetPropertyName": "image",
                                "url": "https://www.bing.com/search?q=sullenberger&filters=ufn%3a%22sullenberger%22+sid%3a%22c1595955-d13e-0209-a3fc-8dd4f4f39e0d%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_cfb02057%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                            }]
                        }
                    }, {
                        "relatedThing": {
                            "id": "6d7d66a7-2cb8-0ae9-637c-f81fd749dc9a",
                            "readLink": "https://www.bingapis.com/api/v5/search?q=Brad+Pitt&filters=sid:%226d7d66a7-2cb8-0ae9-637c-f81fd749dc9a%22&responsesize=m&knowledge=1",
                            "name": "Brad Pitt",
                            "url": "https://www.bing.com/search?q=brad+pitt&filters=ufn%3a%22brad+pitt%22+sid%3a%226d7d66a7-2cb8-0ae9-637c-f81fd749dc9a%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_cfb02057%22+segment%3a%22generic.carousel%22&FORM=SNAPST",
                            "image": {
                                "name": "Brad Pitt and Tom Hanks are both Academy Awards winners.",
                                "thumbnailUrl": "https://www.bing.com/th?id=A088020972c3b97680bb4e324c760ba66&c=12&rs=1&qlt=80&cdv=1&pid=16.2",
                                "width": 72,
                                "height": 72
                            },
                            "webSearchUrl": "https://www.bing.com/search?q=Brad+Pitt&filters=sid:%226d7d66a7-2cb8-0ae9-637c-f81fd749dc9a%22&location=lat:47.6812;long:-122.1207;disp:Redmond%2C%20Washington;",
                            "contractualRules": [{
                                "_type": "ContractualRules/MediaAttribution",
                                "targetPropertyName": "image",
                                "url": "https://www.bing.com/search?q=brad+pitt&filters=ufn%3a%22brad+pitt%22+sid%3a%226d7d66a7-2cb8-0ae9-637c-f81fd749dc9a%22+catguid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9_cfb02057%22+segment%3a%22generic.carousel%22&FORM=SNAPST"
                            }]
                        },
                        "description": "Brad Pitt and Tom Hanks are both Academy Awards winners.",
                        "contractualRules": [{
                            "_type": "ContractualRules/LinkAttribution",
                            "targetPropertyName": "description",
                            "mustBeCloseToContent": true,
                            "text": "Text under CC-BY-SA license",
                            "url": "http://creativecommons.org/licenses/by-sa/3.0/"
                        }, {
                            "_type": "ContractualRules/LinkAttribution",
                            "targetPropertyName": "description",
                            "mustBeCloseToContent": true,
                            "text": "Wikipedia",
                            "url": "https://en.wikipedia.org/"
                        }]
                    }]
                }],
                "entityTypeDisplayHint": "American Actor"
            },
            "contractualRules": [{
                "_type": "ContractualRules/MediaAttribution",
                "targetPropertyName": "image",
                "url": "https://www.bing.com/search?q=tom+hanks&filters=ufn%3a%22tom+hanks%22+sid%3a%2247548b76-d91c-5710-e5b2-2c9d709a3be9%22&FORM=SNAPST"
            }, {
                "_type": "ContractualRules/LinkAttribution",
                "targetPropertyName": "description",
                "mustBeCloseToContent": true,
                "text": "Text under CC-BY-SA license",
                "url": "http://creativecommons.org/licenses/by-sa/3.0/"
            }, {
                "_type": "ContractualRules/LinkAttribution",
                "targetPropertyName": "description",
                "mustBeCloseToContent": true,
                "text": "Wikipedia",
                "url": "http://en.wikipedia.org/wiki/Tom_Hanks"
            }]
        }]
    },
    "rankingResponse": {
        "mainline": {
            "items": [{
                "answerType": "Entities",
                "value": {
                    "id": "https://www.bingapis.com/api/v5/#Entities"
                }
            }]
        }
    }
}

Response 401

{
    "error":{
        "statusCode": 401,
        "message": "Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key." 
    }
}

Response 403

{
    "error":{
        "statusCode": 403,
        "message": "Out of call volume quota. Quota will be replenished in 2.12 days." 
    }
}

Response 429

{
    "error":{
        "statusCode": 429,
        "message": "Rate limit is exceeded. Try again in 26 seconds." 
    }
}

Code samples

@ECHO OFF

curl -v -X GET "https://api.cognitive.microsoft.com/bing/v5.0/knowledge/?q={string}&detectEntities={string}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["q"] = "{string}";
            queryString["detectEntities"] = "{string}";
            var uri = "https://api.cognitive.microsoft.com/bing/v5.0/knowledge/?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://api.cognitive.microsoft.com/bing/v5.0/knowledge/");

            builder.setParameter("q", "{string}");
            builder.setParameter("detectEntities", "{string}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
            "q": "{string}",
            "detectEntities": "{string}",
        };
      
        $.ajax({
            url: "https://api.cognitive.microsoft.com/bing/v5.0/knowledge/?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://api.cognitive.microsoft.com/bing/v5.0/knowledge/";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"q={string}",
                         @"detectEntities={string}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://api.cognitive.microsoft.com/bing/v5.0/knowledge/');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'q' => '{string}',
    'detectEntities' => '{string}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'q': '{string}',
    'detectEntities': '{string}',
})

try:
    conn = httplib.HTTPSConnection('api.cognitive.microsoft.com')
    conn.request("GET", "/bing/v5.0/knowledge/?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'q': '{string}',
    'detectEntities': '{string}',
})

try:
    conn = http.client.HTTPSConnection('api.cognitive.microsoft.com')
    conn.request("GET", "/bing/v5.0/knowledge/?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://api.cognitive.microsoft.com/bing/v5.0/knowledge/')
uri.query = URI.encode_www_form({
    # Request parameters
    'q' => '{string}',
    'detectEntities' => '{string}'
})

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body