{
  "openapi": "3.0.1",
  "info": {
    "title": "GBIF Species & Occurrence API Scraper",
    "description": "Extract biodiversity data from the Global Biodiversity Information Facility (GBIF). Dual-mode: species mode retrieves taxonomy, vernacular names, synonyms, and distributions; occurrence mode streams georeferenced observation records for species distribution modelling and conservation analysis.",
    "version": "0.1",
    "x-build-id": "OmuGdttXQk3vBTnmo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jungle_synthesizer~gbif-species-occurrence-api-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jungle_synthesizer-gbif-species-occurrence-api-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/jungle_synthesizer~gbif-species-occurrence-api-scraper/runs": {
      "post": {
        "operationId": "runs-sync-jungle_synthesizer-gbif-species-occurrence-api-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/jungle_synthesizer~gbif-species-occurrence-api-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-jungle_synthesizer-gbif-species-occurrence-api-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": {
          "sp_intended_usage": {
            "title": "What is the intended usage of this data?",
            "minLength": 1,
            "type": "string",
            "description": "Please describe how you plan to use the data extracted by this crawler."
          },
          "sp_improvement_suggestions": {
            "title": "How can we improve this crawler for you?",
            "minLength": 1,
            "type": "string",
            "description": "Provide any feedback or suggestions for improvements."
          },
          "sp_contact": {
            "title": "Contact Email",
            "minLength": 1,
            "type": "string",
            "description": "Provide your email address so we can get in touch with you."
          },
          "mode": {
            "title": "Scrape Mode",
            "enum": [
              "species",
              "occurrence"
            ],
            "type": "string",
            "description": "Which dataset to scrape: 'species' retrieves taxonomy + enrichment (vernacular names, synonyms, distributions, descriptions); 'occurrence' streams georeferenced observation records.",
            "default": "species"
          },
          "query": {
            "title": "Search Query",
            "type": "string",
            "description": "Free-text search query (e.g. 'Acer', 'Quercus robur', 'Plantae'). Leave blank to stream all records matching other filters."
          },
          "higherTaxonKey": {
            "title": "Higher Taxon Key",
            "type": "integer",
            "description": "GBIF backbone key for a higher taxon. Use to fetch all species within a kingdom, phylum, class, order, or family. Example: 6 = Plantae, 1 = Animalia."
          },
          "rank": {
            "title": "Taxonomic Rank Filter (species mode)",
            "enum": [
              "",
              "SPECIES",
              "GENUS",
              "FAMILY",
              "ORDER",
              "CLASS",
              "PHYLUM",
              "KINGDOM",
              "SUBSPECIES",
              "VARIETY"
            ],
            "type": "string",
            "description": "Restrict species-mode results to this rank. Leave blank for all ranks."
          },
          "taxonomicStatus": {
            "title": "Taxonomic Status Filter (species mode)",
            "enum": [
              "",
              "ACCEPTED",
              "SYNONYM",
              "DOUBTFUL"
            ],
            "type": "string",
            "description": "Restrict species-mode results to ACCEPTED names only, SYNONYM only, or all."
          },
          "datasetKey": {
            "title": "Dataset Key (species/occurrence)",
            "type": "string",
            "description": "Restrict to a specific GBIF dataset UUID. Example: 'd7dddbf4-2cf0-4f39-9b2a-bb099caae36c' for the GBIF backbone taxonomy."
          },
          "countryCode": {
            "title": "Country Code (occurrence mode)",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code to filter occurrence records (e.g. 'US', 'GB', 'AU'). Only used in occurrence mode."
          },
          "yearFrom": {
            "title": "Year From (occurrence mode)",
            "type": "integer",
            "description": "Filter occurrences recorded on or after this year. Also used for year-chunking to bypass the 100k offset cap."
          },
          "yearTo": {
            "title": "Year To (occurrence mode)",
            "type": "integer",
            "description": "Filter occurrences recorded on or before this year."
          },
          "hasCoordinate": {
            "title": "Has Coordinate Only (occurrence mode)",
            "type": "boolean",
            "description": "When true, return only occurrence records with a decimal latitude and longitude. Recommended for SDM/GIS workflows.",
            "default": false
          },
          "enrich": {
            "title": "Enrich Species Records",
            "type": "boolean",
            "description": "When true (default), each accepted species record is enriched with vernacular names, synonyms, geographic distributions, and descriptions via 4 additional API calls. Set to false for faster bulk taxonomy extraction.",
            "default": true
          },
          "maxItems": {
            "title": "Max Items",
            "type": "integer",
            "description": "Maximum number of records to return (0 = unlimited). For occurrence mode without year filters, GBIF caps offset at 100,000; use yearFrom/yearTo chunking or set a maxItems limit.",
            "default": 15
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}