Editing
Knowledge graph api
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
List of Knowledge graph API == List of Knowledge graph API == * ''$'' [https://developers.google.com/knowledge-graph Google Knowledge Graph Search API | Google Developers] * ''$'' [https://products.wolframalpha.com/api/ Wolfram|Alpha APIs: Computational Knowledge Integration] * ''$'' [https://aws.amazon.com/tw/neptune/knowledge-graphs-on-aws/ Knowledge Graphs - Amazon Neptune - Amazon Web Services] * [https://www.wikidata.org/wiki/Wikidata:Data_access Wikidata:Data access - Wikidata] * [https://duckduckgo.com/api DuckDuckGo Instant Answers API]: The original API documentation has been taken offline (Discussion on Reddit<ref>[https://www.reddit.com/r/duckduckgo/comments/xpea65/duckduckgocomapi_redirects_back_to_the_main_page/ DuckDuckGo.com/api redirects back to the main page. Please don't tell me this is the end of the Instant Answers API! : r/duckduckgo] (2022-09-27)</ref>), but the API endpoint can still be used<ref>[https://medium.com/@prateek.vyas/10-must-know-python-code-snippets-for-leveraging-llms-b152fb450ff5 Understand DuckDuckGo Search API: A Practical Guide with step-by-step Python Code Examples | by Prateek Vyas • M.Tech. | Medium] (2024-11-22)</ref>. === Understanding the DuckDuckGo Instant Answers API === '''API Endpoint Structure''' {{kbd | key=<nowiki>https://api.duckduckgo.com/?format=<FORMAT>&q=<QUERY></nowiki>}} Where: * <FORMAT> specifies the response format (e.g., json) * <QUERY> is your URL-encoded search term (e.g., Keira Christina Knightley) Example: https://api.duckduckgo.com/?format=json&q=who%20is%20girl%20friend%20of%20Simba '''Demonstration search term:''' "Keira Christina Knightley" * Web Search Experience: When visiting the [https://duckduckgo.com/?q=Keira+Christina+Knightley&t=h_&ia=web DuckDuckGo search page], users see an information card with text like: "Keira Christina Knightley OBE is an English actress. Known for her work in independent films and blockbusters, particularly period dramas..." * API Integration: This same biographical information can be programmatically accessed via the [https://api.duckduckgo.com/?q=Keira%20Christina%20Knightley&format=json&pretty=1 Instant Answers API] in the "AbstractText" or "Abstract" field of the JSON response. {| class="mw-collapsible mw-collapsed wikitable" ! colspan="2" | Example output of DuckDuckGo Instant Answers API (click to show) |- | <pre> { "Abstract" : "Keira Christina Knightley OBE is an English actress. Known for her work in independent films and blockbusters, particularly period dramas, she has received numerous accolades, including nominations for two Academy Awards, two British Academy Film Awards, four Golden Globes, and a Laurence Olivier Award. In 2018, she was appointed an OBE at Buckingham Palace for services to drama and charity. Born in London to actors Will Knightley and Sharman Macdonald, Knightley obtained an agent at age six and initially worked in commercials and television films. Following a minor role as Sab\u00e9 in Star Wars: Episode I \u2013 The Phantom Menace, her breakthrough came when she played a tomboy footballer in Bend It Like Beckham and co-starred in Love Actually. She achieved global recognition for playing Elizabeth Swann in the Pirates of the Caribbean film series. For her portrayal of Elizabeth Bennet in Pride & Prejudice, Knightley was nominated for the Academy Award for Best Actress.", "AbstractSource" : "Wikipedia", "AbstractText" : "Keira Christina Knightley OBE is an English actress. Known for her work in independent films and blockbusters, particularly period dramas, she has received numerous accolades, including nominations for two Academy Awards, two British Academy Film Awards, four Golden Globes, and a Laurence Olivier Award. In 2018, she was appointed an OBE at Buckingham Palace for services to drama and charity. Born in London to actors Will Knightley and Sharman Macdonald, Knightley obtained an agent at age six and initially worked in commercials and television films. Following a minor role as Sab\u00e9 in Star Wars: Episode I \u2013 The Phantom Menace, her breakthrough came when she played a tomboy footballer in Bend It Like Beckham and co-starred in Love Actually. She achieved global recognition for playing Elizabeth Swann in the Pirates of the Caribbean film series. For her portrayal of Elizabeth Bennet in Pride & Prejudice, Knightley was nominated for the Academy Award for Best Actress.", "AbstractURL" : "https://en.wikipedia.org/wiki/Keira_Knightley", "Answer" : "", "AnswerType" : "", "Definition" : "", "DefinitionSource" : "", "DefinitionURL" : "", "Entity" : "actor", "Heading" : "Keira Knightley", "Image" : "/i/4a6ac0950a7fdca2.jpg", "ImageHeight" : 270, "ImageIsLogo" : 0, "ImageWidth" : 203, "Infobox" : { "content" : [ { "data_type" : "string", "label" : "Born", "value" : "Keira Christina Knightley, March 26, 1985, London, England", "wiki_order" : 0 }, { "data_type" : "string", "label" : "Age", "value" : "40 years", "wiki_order" : 0 }, { "data_type" : "string", "label" : "Occupation", "value" : "Actress", "wiki_order" : 1 }, { "data_type" : "string", "label" : "Years active", "value" : "1991\u2013present", "wiki_order" : 2 }, { "data_type" : "string", "label" : "Children", "value" : "2", "wiki_order" : 4 }, { "data_type" : "string", "label" : "Parent(s)", "value" : "Will Knightley, Sharman Macdonald", "wiki_order" : 5 }, { "data_type" : "instagram_profile", "label" : "Instagram profile", "value" : "keiraknightley", "wiki_order" : "103" }, { "data_type" : "imdb_id", "label" : "IMDb ID", "value" : "nm0461136", "wiki_order" : "106" }, { "data_type" : "rotten_tomatoes", "label" : "Rotten Tomatoes ID", "value" : "celebrity/kiira_naiteulri", "wiki_order" : "107" }, { "data_type" : "spotify_artist_id", "label" : "Spotify Artist ID", "value" : "2MG46ekjBSFwPgzoIZvHFU", "wiki_order" : "108" }, { "data_type" : "instance", "label" : "Instance of", "value" : { "entity-type" : "item", "id" : "Q5", "numeric-id" : 5 }, "wiki_order" : "207" }, { "data_type" : "date_of_birth", "label" : "Born", "value" : { "after" : 0, "before" : 0, "calendarmodel" : "http://www.wikidata.org/entity/Q1985727", "precision" : 11, "time" : "+1985-03-26T00:00:00Z", "timezone" : 0 }, "wiki_order" : "209" }, { "data_type" : "wd_description", "label" : "Wikidata description", "value" : "British actress", "wiki_order" : "210" }, { "data_type" : "wikidata_id", "label" : "Wikidata id", "value" : "Q42581", "wiki_order" : "211" }, { "data_type" : "wikidata_label", "label" : "Wikidata label", "value" : "Keira Knightley", "wiki_order" : "212" }, { "data_type" : "wikidata_aliases", "label" : "Wikidata aliases", "value" : [ "Keira Knightley", "Keira Christina Knightley", "Keira Christina Righton" ], "wiki_order" : "213" } ], "meta" : [ { "data_type" : "string", "label" : "article_title", "value" : "Keira Knightley" }, { "data_type" : "string", "label" : "template_name", "value" : "infobox person" }, { "data_type" : "string", "label" : "above", "value" : "Keira Knightley" }, { "data_type" : "string", "label" : "caption", "value" : "Knightley in 2011" } ] }, "Redirect" : "", "RelatedTopics" : [ { "FirstURL" : "https://duckduckgo.com/c/English_video_game_actresses", "Icon" : { "Height" : "", "URL" : "", "Width" : "" }, "Result" : "<a href=\"https://duckduckgo.com/c/English_video_game_actresses\">English video game actresses</a>", "Text" : "English video game actresses" }, { "FirstURL" : "https://duckduckgo.com/c/English_radio_actresses", "Icon" : { "Height" : "", "URL" : "", "Width" : "" }, "Result" : "<a href=\"https://duckduckgo.com/c/English_radio_actresses\">English radio actresses</a>", "Text" : "English radio actresses" }, { "FirstURL" : "https://duckduckgo.com/c/English_child_actresses", "Icon" : { "Height" : "", "URL" : "", "Width" : "" }, "Result" : "<a href=\"https://duckduckgo.com/c/English_child_actresses\">English child actresses</a>", "Text" : "English child actresses" }, { "FirstURL" : "https://duckduckgo.com/c/English_people_with_disabilities", "Icon" : { "Height" : "", "URL" : "", "Width" : "" }, "Result" : "<a href=\"https://duckduckgo.com/c/English_people_with_disabilities\">English people with disabilities</a>", "Text" : "English people with disabilities" }, { "FirstURL" : "https://duckduckgo.com/c/English_voice_actresses", "Icon" : { "Height" : "", "URL" : "", "Width" : "" }, "Result" : "<a href=\"https://duckduckgo.com/c/English_voice_actresses\">English voice actresses</a>", "Text" : "English voice actresses" }, { "FirstURL" : "https://duckduckgo.com/c/English_atheists", "Icon" : { "Height" : "", "URL" : "", "Width" : "" }, "Result" : "<a href=\"https://duckduckgo.com/c/English_atheists\">English atheists</a>", "Text" : "English atheists" } ], "Results" : [], "Type" : "A", "meta" : { "attribution" : null, "blockgroup" : null, "created_date" : null, "description" : "Wikipedia", "designer" : null, "dev_date" : null, "dev_milestone" : "live", "developer" : [ { "name" : "DDG Team", "type" : "ddg", "url" : "http://www.duckduckhack.com" } ], "example_query" : "nikola tesla", "id" : "wikipedia_fathead", "is_stackexchange" : null, "js_callback_name" : "wikipedia", "live_date" : null, "maintainer" : { "github" : "duckduckgo" }, "name" : "Wikipedia", "perl_module" : "DDG::Fathead::Wikipedia", "producer" : null, "production_state" : "online", "repo" : "fathead", "signal_from" : "wikipedia_fathead", "src_domain" : "en.wikipedia.org", "src_id" : 1, "src_name" : "Wikipedia", "src_options" : { "directory" : "", "is_fanon" : 0, "is_mediawiki" : 1, "is_wikipedia" : 1, "language" : "en", "min_abstract_length" : "20", "skip_abstract" : 0, "skip_abstract_paren" : 0, "skip_end" : "0", "skip_icon" : 0, "skip_image_name" : 0, "skip_qr" : "", "source_skip" : "", "src_info" : "" }, "src_url" : null, "status" : "live", "tab" : "About", "topic" : [ "productivity" ], "unsafe" : 0 } } </pre> To check the API result, open the [https://api.duckduckgo.com/?q=Keira%20Christina%20Knightley&format=json&pretty=1 URL] directly. |} Known Limitation {{exclaim}}: There's currently a discrepancy between web search results and API responses for certain queries. For instance, searching for "height of eiffel tower" produces different results depending on whether you use the web interface or the API endpoint. == References == <references /> [[Category: Tool]]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Exclaim
(
edit
)
Template:Kbd
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information