{
  "openapi": "3.0.1",
  "info": {
    "title": "NIH RePORTER Scraper [$1.50/1K 💰] | Grant Data",
    "description": "Scrape NIH RePORTER grants and publications: titles, abstracts, PIs, organizations, funding, award amounts, study sections and COVID-19 flags. $1.50 per 1,000.",
    "version": "0.1",
    "x-build-id": "eNQPVBrjlsOrcD09j"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ahmed_jasarevic~nih-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ahmed_jasarevic-nih-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/ahmed_jasarevic~nih-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ahmed_jasarevic-nih-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/ahmed_jasarevic~nih-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ahmed_jasarevic-nih-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Search Mode",
            "enum": [
              "projects",
              "publications"
            ],
            "type": "string",
            "description": "Choose the search endpoint to use.",
            "default": "projects"
          },
          "criteria": {
            "title": "Search Criteria",
            "type": "object",
            "description": "Search criteria for filtering projects. See NIH RePORTER API documentation for all available fields.",
            "properties": {
              "fiscal_years": {
                "title": "Fiscal Years",
                "type": "array",
                "description": "One or more fiscal years to filter projects (e.g., [2023, 2024]). Empty array = all years.",
                "items": {
                  "type": "integer"
                },
                "default": []
              },
              "include_active_projects": {
                "title": "Include Active Projects",
                "type": "boolean",
                "description": "Whether to include active projects in results.",
                "default": true
              },
              "org_names": {
                "title": "Organization Names",
                "type": "array",
                "description": "Organization names to filter by (wildcard search). Example: [\"HARVARD MEDICAL SCHOOL\", \"STANFORD\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "org_names_exact_match": {
                "title": "Organization Names (Exact Match)",
                "type": "array",
                "description": "Organization names for exact matching (no wildcard).",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "org_states": {
                "title": "Organization States",
                "type": "array",
                "description": "US states/territories (2-letter codes). Example: [\"MA\", \"CA\", \"NY\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "org_cities": {
                "title": "Organization Cities",
                "type": "array",
                "description": "Organization cities to filter by.",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "org_countries": {
                "title": "Organization Countries",
                "type": "array",
                "description": "Organization countries to filter by.",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "pi_names": {
                "title": "PI Names",
                "type": "array",
                "description": "Principal Investigator names to search for. Each entry can have any_name, first_name, last_name, middle_name. Wildcard enabled.",
                "items": {
                  "type": "object",
                  "properties": {
                    "any_name": {
                      "type": "string",
                      "title": "Any Name",
                      "description": "Search any part of the name (wildcard enabled)"
                    },
                    "first_name": {
                      "type": "string",
                      "title": "First Name",
                      "description": "First name (wildcard enabled)"
                    },
                    "last_name": {
                      "type": "string",
                      "title": "Last Name",
                      "description": "Last name (wildcard enabled)"
                    },
                    "middle_name": {
                      "type": "string",
                      "title": "Middle Name",
                      "description": "Middle name (wildcard enabled)"
                    }
                  }
                },
                "default": []
              },
              "project_nums": {
                "title": "Project Numbers",
                "type": "array",
                "description": "Project numbers to filter by. Supports wildcard (*). Example: [\"5R01DK*\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "appl_ids": {
                "title": "Application IDs",
                "type": "array",
                "description": "NIH application IDs to filter by.",
                "items": {
                  "type": "integer"
                },
                "default": []
              },
              "agencies": {
                "title": "Agencies (Funding ICs)",
                "type": "array",
                "description": "Funding institutes/centers. Example: [\"NIGMS\", \"NIAID\", \"NCI\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "activity_codes": {
                "title": "Activity Codes",
                "type": "array",
                "description": "NIH activity codes. Example: [\"R01\", \"R21\", \"F32\", \"P30\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "award_types": {
                "title": "Award Types",
                "type": "array",
                "description": "Award type codes. Example: [\"1\", \"5\", \"4C\", \"4N\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "spending_categories": {
                "title": "Spending Categories",
                "type": "object",
                "description": "NIH spending category filters.",
                "properties": {
                  "values": {
                    "title": "Category IDs",
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Category IDs (e.g., [27, 92])"
                  },
                  "match_all": {
                    "title": "Match All",
                    "type": "boolean",
                    "description": "If true, match all categories; if false, match any.",
                    "default": false
                  }
                },
                "default": {
                  "values": [],
                  "match_all": false
                }
              },
              "funding_mechanism": {
                "title": "Funding Mechanism",
                "type": "array",
                "description": "Funding mechanism codes. Example: [\"SB\", \"Other\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "covid_response": {
                "title": "COVID-19 Response",
                "type": "array",
                "description": "COVID-19 response categories. Options: [\"Reg-CV\", \"CV\", \"C3\", \"C4\", \"C5\", \"C6\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "project_start_date": {
                "title": "Project Start Date Range",
                "description": "Filter projects by project start date range",
                "type": "object",
                "properties": {
                  "from_date": {
                    "title": "From Date",
                    "type": "string",
                    "description": "Start date (YYYY-MM-DD)"
                  },
                  "to_date": {
                    "title": "To Date",
                    "type": "string",
                    "description": "End date (YYYY-MM-DD)"
                  }
                }
              },
              "project_end_date": {
                "title": "Project End Date Range",
                "description": "Filter projects by project end date range",
                "type": "object",
                "properties": {
                  "from_date": {
                    "title": "From Date",
                    "type": "string",
                    "description": "Start date (YYYY-MM-DD)"
                  },
                  "to_date": {
                    "title": "To Date",
                    "type": "string",
                    "description": "End date (YYYY-MM-DD)"
                  }
                }
              },
              "award_amount_range": {
                "title": "Award Amount Range",
                "description": "Filter projects by award amount range",
                "type": "object",
                "properties": {
                  "min_amount": {
                    "title": "Min Amount",
                    "type": "number",
                    "description": "Minimum award amount"
                  },
                  "max_amount": {
                    "title": "Max Amount",
                    "type": "number",
                    "description": "Maximum award amount"
                  }
                }
              },
              "opportunity_numbers": {
                "title": "Opportunity Numbers (FOAs)",
                "type": "array",
                "description": "Funding opportunity announcement numbers. Example: [\"RFA-DA-18-020\", \"PAR-18-218\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "cong_dists": {
                "title": "Congressional Districts",
                "type": "array",
                "description": "Congressional districts. Example: [\"MA-05\", \"CA-12\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "organization_type": {
                "title": "Organization Type",
                "type": "array",
                "description": "Organization types. Example: [\"SCHOOLS OF MEDICINE\", \"SCHOOLS OF ARTS AND SCIENCES\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "dept_types": {
                "title": "Department Types",
                "type": "array",
                "description": "Department types. Example: [\"PEDIATRICS\", \"OBSTETRICS & GYNECOLOGY\"]",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "advanced_text_search": {
                "title": "Advanced Text Search",
                "type": "object",
                "description": "Full-text search in titles, abstracts, and terms.",
                "properties": {
                  "operator": {
                    "title": "Operator",
                    "type": "string",
                    "enum": [
                      "and",
                      "or",
                      "advanced"
                    ],
                    "default": "and",
                    "description": "Logical operator for combining search terms"
                  },
                  "search_field": {
                    "title": "Search Fields",
                    "type": "string",
                    "description": "Comma-separated: projecttitle, terms, abstracttext, or 'all'",
                    "default": "all"
                  },
                  "search_text": {
                    "title": "Search Text",
                    "type": "string",
                    "description": "Text to search for"
                  }
                }
              }
            },
            "default": {}
          },
          "publication_criteria": {
            "title": "Publication Search Criteria",
            "type": "object",
            "description": "Criteria for publication search (used when mode is 'publications').",
            "properties": {
              "pmids": {
                "title": "PMIDs",
                "type": "array",
                "items": {
                  "type": "integer"
                },
                "description": "PubMed IDs to search for",
                "default": []
              },
              "appl_ids": {
                "title": "Application IDs",
                "type": "array",
                "items": {
                  "type": "integer"
                },
                "description": "NIH application IDs to search for",
                "default": []
              },
              "core_project_nums": {
                "title": "Core Project Numbers",
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Core project numbers to find publications for. Supports wildcard (*).",
                "default": []
              }
            },
            "default": {}
          },
          "include_fields": {
            "title": "Include Fields",
            "type": "array",
            "description": "Specific fields to return (limits data transfer). If empty, returns all fields. Example: [\"ApplId\", \"ProjectNum\", \"ProjectTitle\", \"ContactPiName\", \"Organization\", \"AwardAmount\", \"DirectCostAmt\", \"IndirectCostAmt\", \"ProjectStartDate\", \"ProjectEndDate\", \"FullStudySection\", \"CongressionalDistrict\", \"CovidResponse\", \"AbstractText\"]",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "exclude_fields": {
            "title": "Exclude Fields",
            "type": "array",
            "description": "Fields to exclude from results.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "limit": {
            "title": "Results Per Page (Limit)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Number of records per request (max 500).",
            "default": 50
          },
          "max_pages": {
            "title": "Max Pages to Fetch",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of pages to retrieve (0 = unlimited, up to API max). Each page = 'limit' records.",
            "default": 10
          },
          "offset": {
            "title": "Starting Offset",
            "minimum": 0,
            "type": "integer",
            "description": "Starting record offset for pagination (max 14,999).",
            "default": 0
          },
          "sort_field": {
            "title": "Sort Field",
            "type": "string",
            "description": "Field to sort by (e.g., 'project_start_date', 'award_amount', 'appl_id').",
            "default": ""
          },
          "sort_order": {
            "title": "Sort Order",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Sort direction: ascending or descending",
            "default": "desc"
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Select proxies to be used by your crawler."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}