PerslyPersly API
API Reference

Finder

AI-powered medical information search with optional answer generation.

POST https://api.persly.ai/v1/finder

Searches across medical information sources and optionally generates an AI-synthesized answer. When results are returned, each result includes a score field; with reranking, scores indicate relative relevance (higher means more relevant), and without reranking they may be 0.0.

The Finder endpoint always uses the persly-finder-v1 model — no model parameter is needed in the request.

Request Body

ParameterTypeRequiredDefaultDescription
querystringYesSearch query. Must be non-empty.
search_depthstringNo"basic""basic" ($0.035) for quick search or "advanced" ($0.07) for comprehensive results
max_resultsintegerNo5Maximum number of results to return. Range: 1–20.
include_answerbooleanNofalseGenerate an AI-synthesized answer from search results
include_domainsstring[] | nullNonullApply best-effort domain filtering during retrieval. Values are normalized; invalid/non-normalized values can be ignored. Use Domains to discover common values; request-time validation does not enforce strict catalog membership.
exclude_domainsstring[] | nullNonullApply best-effort exclusion filtering during retrieval. Values are normalized; invalid/non-normalized values can be ignored. Use Domains to discover common values; request-time validation does not enforce strict catalog membership.

include_domains and exclude_domains are mutually exclusive. Sending both as non-empty arrays returns 422 validation error.

Response Body

FieldTypeDescription
idstringUnique request ID in fnd_{hex} format
objectstringAlways "finder.result"
createdintegerUnix timestamp
modelstring"persly-finder-v1"
querystringThe input query (echoed back)
answerstring | nullAI-generated answer. null when include_answer: false or no answer is generated.
resultsarray | nullSearch results. null when no results are returned.
results[].titlestringDocument title
results[].urlstringDocument URL
results[].contentstringRelevant excerpt from the document
results[].scorenumberRelative relevance score for comparing returned results (higher means more relevant). Do not assume a fixed 0.0–1.0 range; 0.0 may be returned when reranking is not applied or when a score is unavailable.
usageobjectUsage information
usage.query_countintegerAlways 1
response_timenumberResponse time in seconds (2 decimal places)

Examples

curl https://api.persly.ai/v1/finder \
  -H "Authorization: Bearer $PERSLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "latest guidelines for managing chronic kidney disease",
    "max_results": 3
  }'
import requests

response = requests.post(
    "https://api.persly.ai/v1/finder",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "query": "latest guidelines for managing chronic kidney disease",
        "max_results": 3,
    },
)

data = response.json()
for result in (data.get("results") or []):
    print(f"[{result['score']:.2f}] {result['title']}")
    print(f"  {result['url']}")
    print(f"  {result['content'][:100]}...")
    print()
const response = await fetch("https://api.persly.ai/v1/finder", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "latest guidelines for managing chronic kidney disease",
    max_results: 3,
  }),
});

const data = await response.json();
for (const result of data.results ?? []) {
  console.log(`[${result.score.toFixed(2)}] ${result.title}`);
  console.log(`  ${result.url}`);
}

Response

{
  "id": "fnd_a1b2c3d4e5f6a1b2c3d4e5f6",
  "object": "finder.result",
  "created": 1709000000,
  "model": "persly-finder-v1",
  "query": "latest guidelines for managing chronic kidney disease",
  "answer": null,
  "results": [
    {
      "title": "KDIGO 2024 Clinical Practice Guideline for CKD",
      "url": "https://kdigo.org/guidelines/ckd-evaluation-and-management/",
      "content": "The KDIGO 2024 guideline provides updated recommendations for the evaluation and management of chronic kidney disease...",
      "score": 0.0
    },
    {
      "title": "CKD Management - UpToDate",
      "url": "https://www.uptodate.com/contents/chronic-kidney-disease-management",
      "content": "Management of CKD involves addressing cardiovascular risk, blood pressure control, and slowing disease progression...",
      "score": 0.0
    },
    {
      "title": "Chronic Kidney Disease - NIDDK",
      "url": "https://www.niddk.nih.gov/health-information/kidney-disease/chronic-kidney-disease-ckd",
      "content": "Chronic kidney disease includes conditions that damage your kidneys and decrease their ability to keep you healthy...",
      "score": 0.0
    }
  ],
  "usage": {
    "query_count": 1
  },
  "response_time": 1.23
}

Advanced Search with AI Answer

curl https://api.persly.ai/v1/finder \
  -H "Authorization: Bearer $PERSLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What are the SGLT2 inhibitor benefits in heart failure?",
    "search_depth": "advanced",
    "max_results": 5,
    "include_answer": true
  }'
Response with AI answer
{
  "id": "fnd_...",
  "object": "finder.result",
  "created": 1709000000,
  "model": "persly-finder-v1",
  "query": "What are the SGLT2 inhibitor benefits in heart failure?",
  "answer": "SGLT2 inhibitors have demonstrated significant benefits in heart failure management. Clinical trials (DAPA-HF, EMPEROR-Reduced) have shown reduced hospitalization rates and cardiovascular mortality...",
  "results": [...],
  "usage": {"query_count": 1},
  "response_time": 2.45
}

With Domain Filter

Use Domains to fetch common values before sending filters. Domain tokens are normalized, and invalid/non-normalized values can be ignored rather than raising request validation errors. Filtering is best-effort; off-domain results may still appear.

curl https://api.persly.ai/v1/finder \
  -H "Authorization: Bearer $PERSLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "metformin contraindications",
    "search_depth": "basic",
    "include_domains": ["nih.gov"],
    "max_results": 5
  }'
Exclude specific domains
curl https://api.persly.ai/v1/finder \
  -H "Authorization: Bearer $PERSLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "metformin contraindications",
    "search_depth": "basic",
    "exclude_domains": ["wikipedia.org"]
  }'

Errors

StatusCodeCause
400missing_required_fieldEmpty query string
400invalid_requestInvalid search_depth value
422Request validation error (missing required fields, invalid/non-coercible values, or both domain filters provided as non-empty arrays)
401authentication_errorMissing or invalid Authorization header, or invalid API key (including malformed, unknown, or revoked keys).
402insufficient_creditsCredit balance too low

On this page