Knowledge graph api: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| Line 26: | Line 26: | ||
* 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. | * 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. | ||
<pre> | {| 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.", | "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.", | ||
| Line 34: | Line 37: | ||
(skip) | (skip) | ||
</pre> | </pre> | ||
|} | |||
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. | 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. | ||
Revision as of 20:23, 12 April 2025
List of Knowledge graph API
List of Knowledge graph API
- $ Google Knowledge Graph Search API | Google Developers
- $ Wolfram|Alpha APIs: Computational Knowledge Integration
- $ Knowledge Graphs - Amazon Neptune - Amazon Web Services
- Wikidata:Data access - Wikidata
- DuckDuckGo Instant Answers API: The original API documentation has been taken offline (Discussion on Reddit[1]), but the API endpoint can still be used[2].
Understanding the DuckDuckGo Instant Answers API
API Endpoint Structure https://api.duckduckgo.com/?format=<FORMAT>&q=<QUERY>
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 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 Instant Answers API in the "AbstractText" or "Abstract" field of the JSON response.
| Example output of DuckDuckGo Instant Answers API (click to show) | |
|---|---|
{
"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",
(skip)
| |
Known Limitation
: 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.