Skip to content

Latest commit

 

History

History

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

4. Search clinical trials

Search ClinicalTrials.gov with filters for phase, recruitment status, and posted results.

node 4_search_trials.js

5. Run a systematic review

Screen papers against your criteria and extract data into columns, with exports for each stage.

node 5_systematic_review.js

6. List sessions

List your reports and systematic reviews, newest first.

node 6_list_sessions.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.