# getTopPaymentRecipients

**Identifier:** `openpayments_getTopPaymentRecipients`

**Provider:** [OpenPayments](https://kirha.com/providers/openpayments.md)

Rank US clinicians by general payments (consulting, speaker fees, travel, food...) received in one program year from a company and/or for a drug/device. Core KOL-mapping tool: filter by nature of payment, state or specialty. Requires companyId or productName; productName-only queries scan the whole year and can take up to a minute, so pass companyId when known. Product matching uses the primary product of each payment.

## Run it with the CLI

```bash
kirha tools run openpayments_getTopPaymentRecipients \
  --input '{}'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "openpayments_getTopPaymentRecipients",
  "input": {}
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "companyId": {
      "description": "From searchOpenPaymentsCompanies",
      "pattern": "^\\d+$",
      "type": "string"
    },
    "limit": {
      "default": 20,
      "maximum": 50,
      "minimum": 1,
      "type": "integer"
    },
    "natureOfPayment": {
      "enum": [
        "food_and_beverage",
        "consulting_fee",
        "speaker_fee_non_accredited",
        "speaker_fee_accredited_education",
        "travel_and_lodging",
        "honoraria",
        "education",
        "grant",
        "royalty_or_license",
        "gift",
        "entertainment",
        "charitable_contribution",
        "space_rental_or_facility_fees",
        "long_term_device_loan",
        "debt_forgiveness",
        "acquisitions"
      ],
      "type": "string"
    },
    "productName": {
      "description": "Exact brand/product name as reported, case-insensitive, e.g. Keytruda, Eliquis",
      "minLength": 2,
      "type": "string"
    },
    "programYear": {
      "description": "Program year. Defaults to the latest published year (CMS publishes each June).",
      "maximum": 2100,
      "minimum": 2013,
      "type": "integer"
    },
    "specialty": {
      "description": "Substring of the NUCC taxonomy, e.g. Oncology",
      "minLength": 3,
      "type": "string"
    },
    "state": {
      "description": "US state code, e.g. TX",
      "maxLength": 2,
      "minLength": 2,
      "type": "string"
    }
  },
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "currency": {
      "const": "usd",
      "type": "string"
    },
    "npis": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "programYear": {
      "type": "number"
    },
    "recipients": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "type": "number"
          },
          "city": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "npi": {
            "type": "string"
          },
          "profileId": {
            "type": "string"
          },
          "rank": {
            "type": "number"
          },
          "specialty": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "transactions": {
            "type": "number"
          }
        },
        "required": [
          "rank",
          "npi",
          "amount",
          "transactions"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "context",
    "programYear",
    "currency",
    "recipients",
    "npis"
  ],
  "type": "object"
}
```

## Related tools

Other OpenPayments tools that this tool refers to, or that refer to it.

- [`searchOpenPaymentsCompanies`](https://kirha.com/providers/openpayments/searchOpenPaymentsCompanies.md)
- [`getCompanyPaymentSummary`](https://kirha.com/providers/openpayments/getCompanyPaymentSummary.md)

-----

[All OpenPayments tools](https://kirha.com/providers/openpayments.md) · [< Back to tools list](https://kirha.com/tools.md)