{
  "openapi": "3.0.1",
  "info": {
    "title": "Wikimedia Commons Image Search: Free Images with Credit Lines",
    "description": "One row per Wikimedia Commons file: direct image URL, thumbnail, pixel size, format, license group and terms, whether credit is required, a ready-to-paste credit line, author, description and GPS coordinates. Search by keyword, list a category, look files up by title, or find images near a point.",
    "version": "0.1",
    "x-build-id": "wMZxaQPp3DmAoNN85"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yadroo~wikimedia-commons-images/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yadroo-wikimedia-commons-images",
        "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/yadroo~wikimedia-commons-images/runs": {
      "post": {
        "operationId": "runs-sync-yadroo-wikimedia-commons-images",
        "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/yadroo~wikimedia-commons-images/run-sync": {
      "post": {
        "operationId": "run-sync-yadroo-wikimedia-commons-images",
        "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": "What to fetch",
            "enum": [
              "search",
              "category",
              "files"
            ],
            "type": "string",
            "description": "Pick the job. `search` sends each entry of `queries` - and/or a point from the coordinate fields - to the Commons search engine and applies the filters below. `category` lists the files of each name in `categories`. `files` reads exactly the files named in `fileTitles` and marks anything Commons does not have with `found: false` instead of dropping it. The filter fields are ignored in `files` mode and the run status says so.",
            "default": "search"
          },
          "queries": {
            "title": "Search words",
            "maxItems": 20,
            "type": "array",
            "description": "One search per line, up to 20 per run; each row names the search that found it in `query`. The words go to the engine behind the Commons search box, so its operators work: quotation marks for a phrase (`\"solar eclipse\"`), a leading minus to exclude a word (`cat -drawing`), `incategory:\"Sunflowers\"` to stay inside one category, `insource:` to look in the file description. Words are passed on as typed - the engine does its own stemming and suggests nothing. Used when `mode` is `search`; may be left empty when you search by coordinates instead.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Category names",
            "maxItems": 20,
            "type": "array",
            "description": "One category per line: `Sunflowers`, `Category:Cats by country`, or the address of a category page. The `Category:` prefix is optional and case, spaces and underscores do not matter. Only the files listed directly in the category are returned - subcategories are not followed, and a category that does not exist yields one row with `found: false` so you see which name was wrong. Used when `mode` is `category`.",
            "items": {
              "type": "string"
            }
          },
          "fileTitles": {
            "title": "File titles or file page URLs",
            "maxItems": 200,
            "type": "array",
            "description": "Up to 200 files per run, read 50 at a time: `File:Suncokret 22.jpg`, `Suncokret 22.jpg` or the address of the file page. The `File:` prefix is optional, underscores and spaces are interchangeable, and a title Commons does not know comes back as a row with `found: false` rather than ending the run. Used when `mode` is `files` - handy for turning a list of file names from a Wikipedia article or a dataset into licensing rows.",
            "items": {
              "type": "string"
            }
          },
          "mediaTypes": {
            "title": "Kinds of media",
            "type": "array",
            "description": "Keep only these kinds of file; the filter is sent to the search engine, so a narrow pick does not waste rows. Leave it empty to get everything Commons holds for the search - the repository is not only photographs, it also holds maps, scanned books, sound recordings, video and 3D models. Every row repeats the value in `mediaType`.",
            "items": {
              "type": "string",
              "enum": [
                "bitmap",
                "drawing",
                "video",
                "audio",
                "office",
                "3d"
              ],
              "enumTitles": [
                "Photos and scans (JPEG, PNG, TIFF, GIF)",
                "Vector drawings (SVG)",
                "Video",
                "Audio",
                "Documents (PDF, DjVu)",
                "3D models"
              ]
            }
          },
          "fileFormats": {
            "title": "File formats",
            "type": "array",
            "description": "Narrower than `mediaTypes`: keep only these formats, matched on the file's media type as the repository records it (`image/jpeg`, `image/svg+xml`, `application/pdf` and so on). Empty means any format. Useful when a pipeline only accepts one container - SVG for icons that must scale, JPEG for photo training sets.",
            "items": {
              "type": "string",
              "enum": [
                "jpeg",
                "png",
                "gif",
                "svg",
                "tiff",
                "webp",
                "pdf"
              ],
              "enumTitles": [
                "JPEG",
                "PNG",
                "GIF",
                "SVG",
                "TIFF",
                "WebP",
                "PDF"
              ]
            }
          },
          "minWidthPx": {
            "title": "At least this wide (px)",
            "minimum": 1,
            "maximum": 30000,
            "type": "integer",
            "description": "Keep files at least this many pixels wide. The size filter is part of the search query, so small thumbnails never reach your dataset and never cost a row. Rough guides: 1200 for a blog image, 2000 for print at a readable size, 4000 for a full-page photograph. Vector drawings have a nominal width that is usually small - leave this empty when you ask for SVG."
          },
          "minHeightPx": {
            "title": "At least this tall (px)",
            "minimum": 1,
            "maximum": 30000,
            "type": "integer",
            "description": "Keep files at least this many pixels tall, combined with `minWidthPx` when you set both. Use it alone for portrait-shaped images."
          },
          "licenseGroups": {
            "title": "License groups",
            "type": "array",
            "description": "Keep only files whose license falls into one of these groups; every row says which group it is in (`licenseGroup`) next to the license as the file page states it (`licenseShortName`, `licenseCode`, `licenseUrl`). The groups are read from the file page after the metadata arrives, so picking one costs no extra requests but can thin out a page of results. Commons rejects files that forbid commercial use or derivative works, so no row is limited that way. Rights that do not come from the license - people shown in a photo, trademarks, buildings in countries without freedom of panorama - are not covered here and stay your responsibility.",
            "items": {
              "type": "string",
              "enum": [
                "public-domain",
                "cc0",
                "cc-by",
                "cc-by-sa",
                "gfdl",
                "other-free"
              ],
              "enumTitles": [
                "Public domain - no permission, no credit needed",
                "CC0 - credit welcome but not required",
                "CC BY - credit required",
                "CC BY-SA - credit required, derivatives stay free",
                "GFDL",
                "Another free license"
              ]
            }
          },
          "latitude": {
            "title": "Centre latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Latitude of a point to search around, decimal degrees, north positive. Use it with `longitude` and `radiusKm` to get only files whose own coordinates sit in that circle - the way to collect pictures of one street, site or landmark. Works with or without search words, and the coordinates of each file come back in `latitude` and `longitude`. Only files whose uploader geotagged them can match."
          },
          "longitude": {
            "title": "Centre longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Longitude of the centre point, decimal degrees, east positive. Needed together with `latitude`; one without the other is refused with a clear message before any request goes out."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How far from the centre point to look, in kilometres. Ignored unless `latitude` and `longitude` are both set. A city centre is well covered at 2-5 km; a whole metropolitan area needs 25-50.",
            "default": 10
          },
          "sortBy": {
            "title": "Order of results",
            "enum": [
              "relevance",
              "newest-uploads",
              "oldest-uploads",
              "recently-edited",
              "random"
            ],
            "type": "string",
            "description": "`relevance` is the ranking of the Commons search box. `newest-uploads` and `oldest-uploads` go by the day the file page was created, which is what you want for watching a topic or for digging out historical uploads. `random` draws a different sample every run - useful for building a balanced training set instead of the same top results. In `category` mode only `relevance` (the category's own order), `newest-uploads` and `oldest-uploads` (the time the file was added to the category) exist; the other two fall back to the category order and the run status says so.",
            "default": "relevance"
          },
          "addedSinceHours": {
            "title": "Added to the category in the last N hours",
            "minimum": 1,
            "maximum": 8760,
            "type": "integer",
            "description": "Category mode only: keep files that were added to the category within this many hours, counted in UTC - 24 for a day, 168 for a week. In keyword search this is ignored (the search engine has no date filter) and the run status names it; use `sortBy: newest-uploads` with `onlyNew` there instead."
          },
          "onlyNew": {
            "title": "Only files not delivered before",
            "type": "boolean",
            "description": "For scheduled runs: skip files this actor already returned to you. The page id of every delivered file is kept in the actor's key-value store, so the next run only pays for and returns what is new. Pair it with `sortBy: newest-uploads` to watch a topic or a category. The first run has nothing remembered and returns everything that matches.",
            "default": false
          },
          "thumbnailWidthPx": {
            "title": "Thumbnail width (px)",
            "minimum": 0,
            "maximum": 2048,
            "type": "integer",
            "description": "Width of the scaled copy whose address goes into `thumbnailUrl`, together with its real `thumbnailWidthPx` and `thumbnailHeightPx`. 0 asks for no thumbnail at all. The repository scales at most 50 images per request, which is exactly the page size this actor uses. A file narrower than the width you ask for is handed back at its own size - nothing is blown up.",
            "default": 320
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on the rows this run writes, and so on what it costs. Rows are collected 50 at a time; with several searches the cap is shared between them in the order you listed them. The run also stops at the maximum cost per run you set on the platform, and says in its status how many rows it saved.",
            "default": 50
          },
          "fields": {
            "title": "Only these columns",
            "type": "array",
            "description": "Keep only the named columns, in the order given - for example `fileUrl, licenseShortName, attributionText`. Empty = every column. `query`, `fileName`, `url`, `fileUrl`, `licenseShortName`, `found` and `fetchedAt` are always present; name one of them here and it moves to the position you gave it. Unknown names are reported in the run's status message instead of being dropped in silence.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}