Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Elicit API — JavaScript Examples

Minimal scripts showing how to call the Elicit API from Node.js using native fetch.

Prerequisites

  • Node.js 18+ (for native fetch and top-level await)
  • An Elicit API key (account settings)
export ELICIT_API_KEY="your-api-key"

No dependencies to install — the package.json just sets "type": "module" for ESM support.

Examples

1. Search papers

Search for academic papers with a research question.

node 1_search.js

2. Filtered search

Narrow results by study type, publication year, and journal quartile.

node 2_filtered_search.js

3. Create a report

Generate an AI-powered research report. Reports take 5-15 minutes — the script polls until completion.

node 3_create_report.js

Notes

  • These examples use top-level await, which requires ESM ("type": "module" in package.json) or the --input-type=module flag.
  • No HTTP library is needed — Node 18+ includes fetch globally.
  • Error handling is intentionally minimal to keep the examples readable. See the CLI tool or Slack bot for production patterns.

See the API documentation for all available parameters and filters.