{
 "source": "Lirevon",
 "license": "CC BY 4.0",
 "url": "https://lirevon.com/developers",
 "openapi": "3.1.0",
 "info": {
  "title": "Lirevon open data API",
  "version": "1.0.0",
  "summary": "Free, read-only JSON about US trees, tree pests, tree work licences, city tree rules and the tree service market.",
  "description": "Static JSON files, rebuilt each time lirevon.com is built. No key, no sign-up. Licence CC BY 4.0: credit \"Lirevon (lirevon.com)\" and link to the page in each file's \"url\" field. Please cache the files. Docs: https://lirevon.com/developers",
  "license": {
   "name": "CC BY 4.0",
   "identifier": "CC-BY-4.0",
   "url": "https://creativecommons.org/licenses/by/4.0/"
  },
  "contact": {
   "name": "Lirevon",
   "url": "https://lirevon.com/developers",
   "email": "hello@lirevon.com"
  }
 },
 "servers": [
  {
   "url": "https://lirevon.com/api/v1"
  }
 ],
 "externalDocs": {
  "description": "Developer docs",
  "url": "https://lirevon.com/developers"
 },
 "paths": {
  "/index.json": {
   "get": {
    "operationId": "getIndex",
    "summary": "List of every endpoint, the licence and the update date.",
    "tags": [
     "Open data"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "endpoints": {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           }
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/species.json": {
   "get": {
    "operationId": "listSpecies",
    "summary": "All tree species (short rows).",
    "tags": [
     "Open data"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "count": {
             "type": "integer"
            },
            "items": {
             "type": "array",
             "items": {
              "type": "object",
              "additionalProperties": true
             }
            }
           }
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/species/{slug}.json": {
   "get": {
    "operationId": "getSpecies",
    "summary": "One tree species with every field.",
    "tags": [
     "Open data"
    ],
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "description": "Species slug from species.json",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      },
      "example": "american-beech"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "species": {
             "type": "object",
             "additionalProperties": true
            }
           }
          }
         ]
        }
       }
      }
     },
     "404": {
      "description": "No file for that slug."
     }
    }
   }
  },
  "/problems.json": {
   "get": {
    "operationId": "listProblems",
    "summary": "All tree pests and diseases (short rows).",
    "tags": [
     "Open data"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "count": {
             "type": "integer"
            },
            "items": {
             "type": "array",
             "items": {
              "type": "object",
              "additionalProperties": true
             }
            }
           }
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/problems/{slug}.json": {
   "get": {
    "operationId": "getProblem",
    "summary": "One pest or disease with every field.",
    "tags": [
     "Open data"
    ],
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "description": "Problem slug from problems.json",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      },
      "example": "ambrosia-beetles"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "problem": {
             "type": "object",
             "additionalProperties": true
            }
           }
          }
         ]
        }
       }
      }
     },
     "404": {
      "description": "No file for that slug."
     }
    }
   }
  },
  "/licensing.json": {
   "get": {
    "operationId": "listLicensing",
    "summary": "Tree work licence status for every state (short rows).",
    "tags": [
     "Open data"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "count": {
             "type": "integer"
            },
            "items": {
             "type": "array",
             "items": {
              "type": "object",
              "additionalProperties": true
             }
            }
           }
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/licensing/{state}.json": {
   "get": {
    "operationId": "getLicensing",
    "summary": "Licence rules for one state, with official sources.",
    "tags": [
     "Open data"
    ],
    "parameters": [
     {
      "name": "state",
      "in": "path",
      "required": true,
      "description": "State slug, for example north-carolina",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      },
      "example": "north-carolina"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "state": {
             "type": "object",
             "additionalProperties": true
            }
           }
          }
         ]
        }
       }
      }
     },
     "404": {
      "description": "No file for that slug."
     }
    }
   }
  },
  "/tree-care/{state}.json": {
   "get": {
    "operationId": "getTreeCare",
    "summary": "Tree care notes for one state.",
    "tags": [
     "Open data"
    ],
    "parameters": [
     {
      "name": "state",
      "in": "path",
      "required": true,
      "description": "State slug, for example north-carolina",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      },
      "example": "north-carolina"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "state": {
             "type": "object",
             "additionalProperties": true
            }
           }
          }
         ]
        }
       }
      }
     },
     "404": {
      "description": "No file for that slug."
     }
    }
   }
  },
  "/calendar.json": {
   "get": {
    "operationId": "getCalendar",
    "summary": "All twelve months of the tree care calendar.",
    "tags": [
     "Open data"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "count": {
             "type": "integer"
            },
            "months": {
             "type": "array",
             "items": {
              "type": "object",
              "additionalProperties": true
             }
            }
           }
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/ordinances.json": {
   "get": {
    "operationId": "listOrdinances",
    "summary": "City tree rules (short rows).",
    "tags": [
     "Open data"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "count": {
             "type": "integer"
            },
            "items": {
             "type": "array",
             "items": {
              "type": "object",
              "additionalProperties": true
             }
            }
           }
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/ordinances/{city}.json": {
   "get": {
    "operationId": "getOrdinance",
    "summary": "Tree rules for one city, with official sources.",
    "tags": [
     "Open data"
    ],
    "parameters": [
     {
      "name": "city",
      "in": "path",
      "required": true,
      "description": "City slug from ordinances.json",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      },
      "example": "auburn"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "city": {
             "type": "object",
             "additionalProperties": true
            }
           }
          }
         ]
        }
       }
      }
     },
     "404": {
      "description": "No file for that slug."
     }
    }
   }
  },
  "/market.json": {
   "get": {
    "operationId": "getMarket",
    "summary": "Market check of US tree companies: total, states and metro areas.",
    "tags": [
     "Open data"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "asOf": {
             "type": "string"
            },
            "total": {
             "type": "object"
            },
            "states": {
             "type": "array",
             "items": {
              "type": "object"
             }
            },
            "cities": {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           }
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/tools.json": {
   "get": {
    "operationId": "listTools",
    "summary": "Every free Lirevon tool.",
    "tags": [
     "Open data"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "count": {
             "type": "integer"
            },
            "tools": {
             "type": "array",
             "items": {
              "type": "object",
              "additionalProperties": true
             }
            }
           }
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/glossary.json": {
   "get": {
    "operationId": "getGlossary",
    "summary": "Every glossary term with a short and a long definition.",
    "tags": [
     "Open data"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "count": {
             "type": "integer"
            },
            "terms": {
             "type": "array",
             "items": {
              "type": "object",
              "additionalProperties": true
             }
            }
           }
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/answers.json": {
   "get": {
    "operationId": "getAnswers",
    "summary": "Every short answer page.",
    "tags": [
     "Open data"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Envelope"
          },
          {
           "type": "object",
           "properties": {
            "count": {
             "type": "integer"
            },
            "answers": {
             "type": "array",
             "items": {
              "type": "object",
              "additionalProperties": true
             }
            }
           }
          }
         ]
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Envelope": {
    "type": "object",
    "required": [
     "source",
     "license",
     "url"
    ],
    "properties": {
     "source": {
      "type": "string",
      "const": "Lirevon"
     },
     "license": {
      "type": "string",
      "const": "CC BY 4.0"
     },
     "licenseUrl": {
      "type": "string",
      "format": "uri"
     },
     "attribution": {
      "type": "string"
     },
     "url": {
      "type": "string",
      "format": "uri",
      "description": "The lirevon.com page this data comes from. Link to it when you use the data."
     },
     "updated": {
      "type": "string",
      "format": "date"
     }
    }
   }
  }
 }
}
