Concept Architecture
Application Programming Interface in Evidence Review and Modelling
An application programming interface, usually shortened to API, is the agreed contract that says which requests a software service accepts and what it sends back. The caller needs only that contract, so an analyst's R or Python script can retrieve trial records, read structured health data or send thousands of abstracts to a large language model without seeing the code that runs the service. NICE ECD20 (2026), the AI methods for evidence framework, lists APIs among four ways of working with AI and favours them for large screening tasks, which makes the handling of each call part of the method.
Requests, responses and the web style behind many APIs
The software that calls an API is the client, and the service that answers is the server. The client sends a request to an endpoint, an address that identifies what it wants, with any parameters and usually some proof of identity, and the server returns a status code and the data in an agreed format. The GOV.UK Service Manual stresses that applications can share data this way without sharing their software code.
Many web APIs follow the Representational State Transfer (REST) style that Fielding defined in his 2000 doctoral dissertation. Communication is stateless, so every request must carry all the information needed to understand it and the server keeps no session memory between calls. A stateless screening call therefore carries the full prompt with every abstract, so no decision depends on the abstracts sent before it.
The UK government's API technical and data standards, last updated on 30 September 2026, recommend the REST style and a new version number in the API's address when a change would break older versions, so the version belongs in the description of any data pull or model call.
Status codes and what a failed call means
Every HTTP response carries a three-digit status code whose first digit gives its class. RFC 9110, the HTTP Semantics standard, defines codes beginning with 2 as success, 4 as a client error such as a malformed request and 5 as a server error. RFC 6585 adds code 429, Too Many Requests, which may carry a Retry-After header saying how long to wait.
A screening script therefore needs a retry rule for 429 and temporary 5xx responses and a fallback rule for records whose calls still fail. NICE ECD20 (2026) makes the fallback cautious. On any model or API failure the record should be included or escalated for human review, and a failure should never cause an automatic exclusion, because that could add false negatives to the systematic review.
Where health economists and HTA analysts meet APIs
Trial registries offer APIs that let a search be scripted and re-run. The ClinicalTrials.gov REST API returns studies page by page, at most 1,000 per page. Its version endpoint reported API version 2.0.5 and a data timestamp of 10 November 2026 when checked for this article, so the same search run on another day can return different records. The retrieval date and data timestamp belong in the search record of any data extraction built on such a pull.
Data held in an electronic health record can be exposed through APIs as well, although economic models usually receive such data as de-identified extracts, not through direct calls to clinical systems. HL7 FHIR calls itself a RESTful specification that defines the same interactions, such as read and search, for every resource type, and states that its API does not itself address authentication, authorisation or audit. Agreement on formats and meanings is the subject of digital interoperability.
AI models are the third use. NICE ECD20 (2026) describes APIs as the route typically used to adjust an AI tool's hyperparameters and other settings from code, often written in Python, and to put large batches of records, such as abstracts awaiting screening, through the tool. An AI agent that decides for itself which calls to make falls outside the current framework, which does not yet cover agents.
What NICE ECD20 asks of API-based screening
For title and abstract screening, NICE ECD20 (2026) favours running every record through one API under a single validated prompt template, which it links to consistency and reproducibility, with a validated off-the-shelf screening platform as the alternative. Chatbots suit large reviews poorly, since one record per session means thousands of sessions and many records in one request run into context window limits. The framework adds that prompt caching, which reuses the repeated part of a prompt across API calls, can cut time and cost.
For health economic evaluation the position is narrower. NICE ECD20 (2026) allows AI only as support with a human closely in the loop, for example writing code that a person then checks and runs, and not for semi-automated or automated model building. An API call that drafts model code or suggests a parameter input is a starting point, and the model validation that follows is unchanged.
A published screening run through a model API
Guo and colleagues wrote a Python script that sent screening criteria in plain language, with each title and abstract, to ChatGPT or GPT-4 through the OpenAI API, choosing the model by input token length. Across six clinical reviews and more than 24,000 titles and abstracts, accuracy against two independent human reviewers was 0.91, but sensitivity for the papers the reviewers had included was 0.76. On one data set of 14,771 abstracts, 354 of them included, the run took 643 minutes and 50.8 seconds at an approximate cost of USD 25. High accuracy sat beside about a quarter of relevant papers missed, and NICE ECD20 (2026) puts the true positive rate and false negative rate ahead of accuracy as primary screening metrics.
Worked example with an illustrative screening run of 1,000 abstracts
All numbers in this example are illustrative. A review team sends 1,000 abstracts, one per request, to a model API with a validated template of 600 tokens plus an abstract averaging 300 tokens. The model is told to answer with a one-token code for include, exclude or unsure, the script caps each answer at one token, and the provider allows 50 requests a minute.
Step 1. Minimum run time. With one abstract per request, the rate limit sets the shortest possible run.
where is the minimum run time in minutes, 1,000 is the number of requests and 50 is the permitted number of requests per minute.
Step 2. Failures and retries. Eighteen requests return code 429 or a 5xx error. After up to three retries, each after the wait set by the Retry-After header when one is sent or a fixed pause when not, 15 succeed and 3 still fail, and those 3 go to human review as NICE ECD20 (2026) requires.
Step 3. Unreadable answers. Of the 997 completed calls, 6 return text that matches none of the three codes, and the script escalates them as unsure.
Step 4. Records sent to people. The remaining 991 answers comprise 140 includes, 820 excludes and 31 unsure.
where is the number of records passed to human reviewers, the records the model included, the records it marked unsure, the unreadable answers and the calls that failed after retries. The 820 model exclusions and 180 records for review add back to 1,000.
Step 5. Cost. Assuming, for illustration, that failed calls are not charged and that prices are GBP 2.50 per million input tokens and GBP 10.00 per million output tokens,
where is the cost in GBP, 897,300 is the number of input tokens (997 completed calls of 900 tokens each), 997 is the number of output tokens (one per completed call) and the divisor converts prices quoted per million tokens.
Step 6. Reading the result. The run costs a few pounds, so the economic question is the price of error. The fallback rule adds 9 records to the human workload and stops any failure removing a relevant study, while the safety of the 820 exclusions depends on the model's validated sensitivity, which the API cannot guarantee, and NICE ECD20 (2026) expects people to check a random sample of AI exclusions when screening is automated.
Choices to record with every API-based analysis
Model providers may update their parameters without any change to the analyst's script. NICE ECD20 (2026) asks for the AI system, model version, settings and configuration to be reported, with the configuration and processing code where possible, and the prompt template, retry and fallback rules and run dates belong beside them. For data APIs the API version and data timestamp play the same role.
Access and governance need equal care. The UK API standards warn that an API key travels with every request, can be intercepted and reused, is secure only over HTTPS, and should be time-limited and changed regularly. NICE ECD20 (2026) leaves users responsible for data protection and confidentiality, which matters when confidential prices or patient data would leave the organisation in a request, and data governance rules decide whether such a call is acceptable. The GOV.UK Service Manual adds that depending on a third-party API can tie a service to that party's availability.
APIs beside chatbots, platforms and connectors
Of the four routes to AI in NICE ECD20 (2026), web-based chatbots hold conversations in a browser, off-the-shelf platforms usually give no direct access to the model, and local deployment runs it on the organisation's own servers, reached much as an external API would be. The API gives the analyst control over each request and lets the script log what was sent and returned.
Neighbouring glossary terms sit on either side of the API. A Connector (AI) gives an AI tool controlled access to an external system such as a database, a role an API plays for software in general, while a Prompt Template fixes the text sent in each call and Token (AI) is the unit of text behind the cost in the worked example.
Common misreadings
Most errors come from stretching the term beyond the access route. Three recur in evidence work.
- Treating the API as the model. The API decides how requests reach a model or data source. Accuracy, sensitivity and bias belong to the model and its configuration and need validation of their own.
- Assuming identical calls give identical answers. Registry data are refreshed between pulls, and for stochastic generative models NICE ECD20 (2026) asks for stable performance across repeated runs instead of strict identity.
- Forgetting what leaves the building. Every request copies its content to the service that answers, so confidential or personal data in a prompt pass to that provider unless the model runs locally.
Sources
- Central Digital and Data Office, Government Digital Service. API technical and data standards. GOV.UK. Published 7 February 2018, last updated 30 September 2026. https://www.gov.uk/guidance/gds-api-technical-and-data-standards
- ClinicalTrials.gov. ClinicalTrials.gov REST API, version 2.0.5, OpenAPI description and version endpoint. Accessed 10 November 2026. https://clinicaltrials.gov/api/oas/v2
- Fielding R, Nottingham M, Reschke J, editors. HTTP Semantics. RFC 9110. Internet Engineering Task Force. June 2022. https://www.rfc-editor.org/rfc/rfc9110
- Fielding RT. Architectural Styles and the Design of Network-based Software Architectures. Doctoral dissertation, University of California, Irvine. 2000. Chapter 5, Representational State Transfer (REST). https://ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm
- GOV.UK Service Manual. Application programming interfaces (APIs). Published 16 December 2016, last updated 17 October 2024. https://www.gov.uk/service-manual/technology/application-programming-interfaces-apis
- Guo E, Gupta M, Deng J, Park YJ, Paget M, Naugler C. Automated paper screening for clinical reviews using large language models: data analysis study. Journal of Medical Internet Research. 2024;26:e48996. https://doi.org/10.2196/48996
- HL7 International. FHIR R5 (v5.0.0), RESTful API. 2023. https://hl7.org/fhir/http.html
- National Institute for Health and Care Excellence. AI methods for evidence framework (ECD20). Published 9 November 2026. Chapters Introduction to AI in NICE decision making, Principles for using AI in evidence activities, AI methods for evidence synthesis, AI methods for health economic evaluation, and Appendix A glossary. https://www.nice.org.uk/corporate/ecd20
- Nottingham M, Fielding R. Additional HTTP Status Codes. RFC 6585. Internet Engineering Task Force. April 2012. https://www.rfc-editor.org/rfc/rfc6585
Related Concepts (2)
Library
Publications
2
Artificial Intelligence to Automate Network Meta-Analyses: Four Case Studies to Evaluate the Potential Application of Large Language Models — Reason T, Benbow E, Langham J, et al, Vol. 8, No. 2, pp. 205-220 ed., 2024 (PharmacoEconomics - Open)
Four case studies of an LLM preparing data and running network meta-analyses that feed economic models.
Journal ArticleView source →Using Generative Artificial Intelligence in Health Economics and Outcomes Research: A Primer on Techniques and Breakthroughs — Reason T, Klijn S, Rawlinson W, et al, Vol. 9, No. 4, pp. 501-517 ed., 2025 (PharmacoEconomics - Open)
Plain primer on generative AI techniques written for HEOR analysts, with examples from reviews and modelling.
Journal ArticleView source →
Frequently Asked Questions (6)
What is Application Programming Interface?
An application programming interface (API) is a defined set of requests and responses through which one piece of software uses another's data or functions.
Source: NICE ECD20 (2026)
How does NICE ECD20 say an application programming interface should be used for abstract screening in a systematic review?
For title and abstract screening, NICE ECD20 (2026) favours passing each record through a single application programming interface with the same validated prompt template, an approach it links to consistency and reproducibility. A validated off-the-shelf screening platform with equivalent safeguards is the alternative. Web chatbots suit large reviews poorly, because one record per session means thousands of sessions and putting many records in one request runs into context window limits. The framework also notes that prompt caching, which reuses the repeated part of a prompt across calls, can reduce time and cost. NICE still treats the true positive rate and false negative rate as the primary screening metrics, ahead of accuracy.
Source: NICE ECD20 (2026)
What should a screening script do when an application programming interface call fails during AI-assisted evidence review?
Calls to an application programming interface can fail when the provider limits the request rate or the server has a temporary fault, so a screening script needs a rule for retrying such calls and a rule for records that still fail. NICE ECD20 (2026) sets that second rule. Any model or API failure should lead to the record being included or escalated for human review. A failure should never cause an automatic exclusion, since that could add false negatives to the systematic review. The cautious fallback adds a few records to the human workload in exchange for keeping any relevant study among the failed records in play.
Source: NICE ECD20 (2026)
Can an application programming interface be used with AI to build a health economic model under NICE ECD20?
NICE ECD20 (2026) takes a narrower position for health economic evaluation than for evidence synthesis. AI may be used only as support with a human closely in the loop, for example to write model code that a person then checks and runs, and not for semi-automated or automated model building. A call to a language model through an application programming interface that drafts model code or suggests a parameter estimate is therefore a starting point for the analyst. The usual model validation that follows is unchanged, and suggested values are not substituted into the model automatically.
Source: NICE ECD20 (2026)
How does HL7 FHIR use an application programming interface to give software access to health record data?
HL7 FHIR describes itself as a RESTful specification, so data held in an electronic health record can be requested over the web by authorised software, although an economic model usually receives such data as a de-identified extract, not through a direct call to a clinical system. FHIR defines the same set of interactions, such as read and search, for every resource type, which means a client written for one kind of record can follow the same pattern for another. The FHIR application programming interface does not itself address authentication, authorisation or audit. Those controls come from the systems around it and from the data governance rules of the organisations that hold and request the data.
Source: HL7 International, FHIR Standard
What did a published study find when abstracts for clinical reviews were screened through a large language model application programming interface?
Guo and colleagues wrote a Python script that sent screening criteria, with each title and abstract, to ChatGPT or GPT-4 through the OpenAI application programming interface, choosing the model by input token length. Across six clinical reviews and more than 24,000 titles and abstracts, accuracy against two independent human reviewers was 0.91, yet sensitivity for the papers the reviewers had included was 0.76. One data set of 14,771 abstracts took about 644 minutes at an approximate cost of USD 25. The run was cheap, but about a quarter of relevant papers were missed, and NICE ECD20 (2026) puts the false negative rate ahead of accuracy as a primary screening metric.
Source: Guo et al. 2024
Trust Record
Verified by Dr Darrin Baines
British health economist
Professional identity: darrinbaines.org
Verification date: 10 Nov 2026
Content version: 1.0.0
Canonical Identity
- Term code
- HS-HP-DH-069
Stable URI · Machine-readable · Resolvable · CC BY 4.0
