{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenAlex Scholarly Works Scraper",
    "description": "Scrape scholarly works (papers, preprints, books), authors, institutions & journals from the free public OpenAlex API. Search + filter by author, institution, concept, year, type & open-access; sort; auto-paginate. Clean columns + raw. Pay per record.",
    "version": "0.1",
    "x-build-id": "KrJjSZwHFU4lCl7rf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~openalex-scholarly-works-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-openalex-scholarly-works-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/datamule~openalex-scholarly-works-scraper/runs": {
      "post": {
        "operationId": "runs-sync-datamule-openalex-scholarly-works-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/datamule~openalex-scholarly-works-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-openalex-scholarly-works-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": {
          "entityType": {
            "title": "What to scrape",
            "enum": [
              "works",
              "authors",
              "institutions",
              "sources"
            ],
            "type": "string",
            "description": "Which OpenAlex entity to query. Works = scholarly outputs (papers, preprints, books, datasets…) with full author/venue/citation metadata (the primary use case). Authors / Institutions / Sources return those entities (name, ids, works & citation counts) — useful for resolving an author/institution/journal id to feed back into a works query.",
            "default": "works"
          },
          "search": {
            "title": "Search term",
            "type": "string",
            "description": "Free-text search. For Works this matches the title, abstract and full text; for Authors/Institutions/Sources it matches their names. e.g. \"machine learning\", \"CRISPR gene editing\", \"Harvard University\". Leave empty to browse by filter/sort only."
          },
          "workType": {
            "title": "Work type (Works only)",
            "type": "string",
            "description": "Restrict Works to a single OpenAlex type, e.g. article, preprint, book, book-chapter, dataset, dissertation, review, report. Leave empty for all types. Ignored for non-Works entities."
          },
          "fromYear": {
            "title": "From year (Works only)",
            "minimum": 1000,
            "type": "integer",
            "description": "Only Works published on/after this year (inclusive). Combine with \"To year\" for a range. Ignored if \"Exact publication year\" is set, or for non-Works entities."
          },
          "toYear": {
            "title": "To year (Works only)",
            "minimum": 1000,
            "type": "integer",
            "description": "Only Works published on/before this year (inclusive). Ignored if \"Exact publication year\" is set, or for non-Works entities."
          },
          "publicationYear": {
            "title": "Exact publication year (Works only)",
            "minimum": 1000,
            "type": "integer",
            "description": "Only Works published in exactly this year. Overrides the From/To year range when set. Ignored for non-Works entities."
          },
          "openAccessOnly": {
            "title": "Open-access only (Works only)",
            "type": "boolean",
            "description": "When on, return only open-access Works (is_oa:true). Ignored for non-Works entities.",
            "default": false
          },
          "authorId": {
            "title": "Author OpenAlex ID (Works only)",
            "type": "string",
            "description": "Restrict Works to those by a given author. Accepts an OpenAlex author id (e.g. A5105141183 or the full https://openalex.org/A5105141183 URL). Tip: run this actor with \"Authors\" first to find the id. Ignored for non-Works entities."
          },
          "institutionId": {
            "title": "Institution OpenAlex ID (Works only)",
            "type": "string",
            "description": "Restrict Works to those affiliated with a given institution (e.g. I136199984 for Harvard). Ignored for non-Works entities."
          },
          "conceptId": {
            "title": "Concept OpenAlex ID (Works only)",
            "type": "string",
            "description": "Restrict Works tagged with a given concept/topic (e.g. C519991488). Ignored for non-Works entities."
          },
          "sourceId": {
            "title": "Source OpenAlex ID (Works only)",
            "type": "string",
            "description": "Restrict Works published in a given source — a journal or repository (e.g. S4306400194 for arXiv). Ignored for non-Works entities."
          },
          "filter": {
            "title": "Advanced raw filter",
            "type": "string",
            "description": "Optional raw OpenAlex filter string, AND-ed onto the structured filters above. Use OpenAlex's own filter grammar for anything not exposed as a field, e.g. \"cited_by_count:>100,has_doi:true\" or \"authorships.countries:US\". See https://docs.openalex.org/api-entities/works/filter-works. For non-Works entities this is the only structured filter input."
          },
          "sort": {
            "title": "Sort",
            "type": "string",
            "description": "How to order results, as \"field:direction\", e.g. \"cited_by_count:desc\" (most-cited first), \"publication_date:desc\" (newest first), \"works_count:desc\" (for authors/institutions). Leave empty for the default relevance order (or a plain listing when there's no search term)."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of records to return. The actor paginates automatically via OpenAlex's cursor (200 per request), so this can be large. Each returned record is one billable item.",
            "default": 200
          },
          "mailto": {
            "title": "Contact email (polite pool)",
            "type": "string",
            "description": "Optional email address added to requests per OpenAlex's polite-pool convention for faster, more reliable service. No account or key is required. If omitted a neutral default is used."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}