{"source":"landbruk","operation":"get_municipality_farming","description":"One municipality's farming totals for a year, from the subsidy applications. Signature: get_municipality_farming(municipality: string, required; year: integer, calendar year, optional, default None; category: string, optional, default None; limit: integer, items, optional, default 25; offset: integer, items, optional, default 0).","signature":"get_municipality_farming(municipality: string, required; year: integer, calendar year, optional, default None; category: string, optional, default None; limit: integer, items, optional, default 25; offset: integer, items, optional, default 0)","parameters":[{"name":"municipality","type":"string","schema":{"type":"string"},"required":true,"default":null,"description":"Municipality name (\"Gloppen\") or number (\"4650\"), as the municipality was in that year. Farms count where their operating centre (driftssenter) is.","unit":null},{"name":"year","type":"integer","schema":{"anyOf":[{"type":"integer"},{"type":"null"}]},"required":false,"default":null,"description":"Application year, 2017 or later (default: last year, or the year before while last year is not yet published). The current year is published in two parts and is incomplete until the autumn round. Unit: calendar year.","unit":"calendar year"},{"name":"category","type":"string","schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":false,"default":null,"description":"Restrict figures to one category: area, produce, animals, crops, pasture, forage_sales, heritage_breeds, organic or subsidy.","unit":null},{"name":"limit","type":"integer","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"display_type":"integer","required":false,"default":25,"description":"Maximum list items returned by the gateway (default 25, maximum 100).","unit":"items"},{"name":"offset","type":"integer","schema":{"type":"integer","minimum":0,"default":0},"display_type":"integer","required":false,"default":0,"description":"Number of list items to skip before returning the page.","unit":"items"}],"json_get_url_template":"https://allemannsdata.com/wiki/api/v1/kilder/landbruk/get_municipality_farming?municipality={municipality}&year={year}&category={category}&limit=25&offset=0","example_url":"https://allemannsdata.com/wiki/api/v1/kilder/landbruk/get_municipality_farming?municipality=Gloppen","schema_scope":"#/data in the successful operation envelope","response_schema":{"type":"object","properties":{"year":{"type":"integer"},"kommunenr":{"type":"string"},"municipality":{"type":["string","null"]},"farm_count":{"type":"integer"},"total_area_daa":{"type":"number"},"total_subsidy_nok":{"type":"number"},"figures":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"category":{"type":"string","enum":["area","produce","animals","crops","pasture","forage_sales","heritage_breeds","organic","subsidy","other"]},"unit":{"type":["string","null"]},"count_date":{"type":["string","null"],"enum":["1 March","1 October",null]},"total":{"type":"number"},"farms":{"type":"integer"}},"additionalProperties":false,"required":["code","label","category","unit","count_date","total","farms"]}}},"additionalProperties":false,"required":["year","kommunenr","municipality","farm_count","total_area_daa","total_subsidy_nok","figures"]},"response_schema_status":{"status":"declared","codegen_safe":true,"description":"Maintained response contract."},"entity_projection":{"status":"intentionally_none","entity_types":[],"description":"No stable cross-source entity projection is defined for this operation; entities is intentionally empty."},"error_contract":{"scope":"top-level HTTP error response; never part of a success payload","schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"details":{"type":"object"}},"additionalProperties":false,"required":["code","message","retryable"]},"suggestion":{"type":"string"},"_meta":{"type":"object","properties":{"retrieved_at":{"type":"string","format":"date-time"},"language":{"type":"string","const":"en"},"content_languages":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"type":"object"}}},"required":["retrieved_at","language","content_languages","sources"]},"_links":{"type":"object","properties":{"self":{"type":"string","format":"uri"},"api_index":{"type":"string","format":"uri"},"feedback":{"type":"string","format":"uri"}},"required":["self","api_index","feedback"],"additionalProperties":false}},"additionalProperties":false,"required":["error","suggestion","_meta","_links"]},"statuses":{"400":{"codes":["MISSING_PARAMETER","INVALID_PARAMETER","INVALID_REQUEST"],"retryable":false},"404":{"codes":["SOURCE_NOT_FOUND","OPERATION_NOT_FOUND","ENTITY_NOT_FOUND","ENDPOINT_NOT_FOUND"],"retryable":false},"405":{"codes":["METHOD_NOT_ALLOWED"],"retryable":false},"429":{"codes":["RATE_LIMITED","GATEWAY_RATE_LIMITED"],"retryable":true},"503":{"codes":["SOURCE_UNAVAILABLE"],"retryable":true},"500":{"codes":["INTERNAL_ERROR"],"retryable":false}}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/landbruk/get_municipality_farming/schema","operation":"https://allemannsdata.com/wiki/api/v1/kilder/landbruk/get_municipality_farming","source":"https://allemannsdata.com/wiki/api/v1/kilder/landbruk","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"},"output_fields":["year","kommunenr","municipality","farm_count","total_area_daa","total_subsidy_nok","figures","figures[].code","figures[].label","figures[].category","figures[].unit","figures[].count_date","figures[].total","figures[].farms"],"output_fields_truncated":false,"canonical_field_aliases":{"identifier":["figures[].code"],"name":["figures[].label"]},"response_example":{"source":"landbruk","operation":"get_municipality_farming","parameters":{"municipality":"Gloppen","limit":25,"offset":0},"data":{"year":1,"kommunenr":"example value","municipality":"example value","farm_count":1,"total_area_daa":1.0,"total_subsidy_nok":1.0,"figures":[{"code":"example value","label":"Example","category":"area","unit":"example value","count_date":"1 March","total":1.0,"farms":1}]},"entities":[],"_meta":{"retrieved_at":"2026-01-15T12:00:00Z","language":"en","content_languages":["en"],"sources":[{"id":"landbruk","name":"Landbruksdirektoratet","description":"Farm subsidy applications (produksjons- og avl\u00f8sertilskudd) per farm and year since 2017: farms, cultivated area, animals by type (dairy cows, sheep, pigs, poultry), crop areas, organic production and subsidies per municipality. Names of sole proprietors and partnerships are withheld.","publisher":"Landbruksdirektoratet","license":"https://data.norge.no/nlod/en/2.0/","cache_ttl_seconds":3600,"documentation":"https://github.com/LandbruksdirektoratetGIT/opendata/tree/main/datasets/produksjon-og-avlosertilskudd"}]},"_provenance":{"data":{"source":"landbruk","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/landbruk"},"entities":{"source":"landbruk","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/landbruk","derived_from":"#/data","description":"Normalized projection of data."}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/landbruk/get_municipality_farming","source":"https://allemannsdata.com/wiki/api/v1/kilder/landbruk","wiki":"https://allemannsdata.com/wiki/kilder/landbruk/get_municipality_farming/","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"}}}
