{
  "openapi": "3.0.1",
  "info": {
    "title": "Norway Restaurant Hygiene Inspections (Mattilsynet Smilefjes)",
    "description": "Get official Norwegian restaurant food-safety inspection results (smilefjes) from Mattilsynet open data. Filter by city, postcode, municipality, org number or grade. No login.",
    "version": "0.1",
    "x-build-id": "vAv73i7bbsLE4pecM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/andreaajohansen~norway-restaurant-hygiene/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-andreaajohansen-norway-restaurant-hygiene",
        "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/andreaajohansen~norway-restaurant-hygiene/runs": {
      "post": {
        "operationId": "runs-sync-andreaajohansen-norway-restaurant-hygiene",
        "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/andreaajohansen~norway-restaurant-hygiene/run-sync": {
      "post": {
        "operationId": "run-sync-andreaajohansen-norway-restaurant-hygiene",
        "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": {
          "city": {
            "title": "City / post town (poststed)",
            "type": "string",
            "description": "Post town as printed in the address, for example Oslo, Bergen, Trondheim or Tromsø. Case-insensitive exact match. Separate several with commas. Leave empty for all of Norway."
          },
          "postcode": {
            "title": "Postcode",
            "type": "string",
            "description": "4-digit Norwegian postcode, for example 0150. Separate several with commas. A shorter value works as a prefix, so 01 matches 0100–0199."
          },
          "municipality": {
            "title": "Municipality (kommune)",
            "type": "string",
            "description": "Municipality name (for example Bærum, Tromsø, Lillestrøm) or 4-digit municipality number (for example 3201). Separate several with commas. Derived from the postcode via the Posten/Bring postcode register."
          },
          "orgNumber": {
            "title": "Organisation number",
            "type": "string",
            "description": "9-digit Norwegian organisation number (Enhetsregisteret) of the business that runs the restaurant. Separate several with commas."
          },
          "nameContains": {
            "title": "Restaurant name contains",
            "type": "string",
            "description": "Case-insensitive text that must appear in the restaurant name, for example sushi, burger king or kebab."
          },
          "minGrade": {
            "title": "Minimum grade (karakter)",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Only keep inspections with a total grade at or above this. 0 = no violations, 1 = minor violations (still a smiling face), 2 = violations requiring follow-up (straight mouth), 3 = serious violations (sad face). Use 2 to find restaurants that did not get a smiling face."
          },
          "maxGrade": {
            "title": "Maximum grade (karakter)",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Only keep inspections with a total grade at or below this. Use 1 to keep only restaurants with a smiling face."
          },
          "dateFrom": {
            "title": "Inspection date from",
            "type": "string",
            "description": "Earliest inspection date (inclusive), YYYY-MM-DD. Data starts in 2016."
          },
          "dateTo": {
            "title": "Inspection date to",
            "type": "string",
            "description": "Latest inspection date (inclusive), YYYY-MM-DD."
          },
          "onlyLatestPerRestaurant": {
            "title": "Only latest inspection per restaurant",
            "type": "boolean",
            "description": "On (default): one row per restaurant with its most recent inspection inside your date range, which is the result on the door poster today. Grade filters apply to that latest result. Off: one row per inspection, including older and follow-up visits.",
            "default": true
          },
          "includeInspectionHistory": {
            "title": "Include inspection history",
            "type": "boolean",
            "description": "When returning the latest inspection per restaurant, also add a compact list of earlier inspections (date, grade, visit type).",
            "default": true
          },
          "includeRequirementPoints": {
            "title": "Include requirement points (kravpunkter)",
            "type": "boolean",
            "description": "Add the individual requirement points checked in each returned inspection (for example hand washing, cold chain, allergen labelling) with their result. Slower: uses Mattilsynet's kravpunkter CSV, or the public smilefjes page when the CSV is unavailable.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many output rows, newest inspections first. Raise it (up to 50,000) for a full extract; Norway has about 8,700 inspected restaurants and 45,000 inspections since 2016.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}