openapi: 3.0.2
servers:
  - description: Production Server
    url: https://mtaa-api.herokuapp.com/api
info:
  contact:
    email: isaackeinstein@gmail.com
    name: Mtaa API
    url: https://github.com/HackEAC/mtaaAPI
  description: Mtaa A simple REST API to access Tanzania's location information,With mtaa API you can easily query and integrate all the location in tanzania from region level to streets from your programming language of your your choice
  license:
    name: MIT License
    url: https://github.com/HackEAC/mtaaAPI/blob/main/LICENSE
  title: Mtaa API Documentation
  version: "1.0"
  x-apisguru-categories:
    - open_data
    - location
  x-origin:
    - format: openapi
      url: https://raw.githubusercontent.com/Kalebu/mtaa-docs/main/openapi.yaml
      version: "3.0"
  x-providerName: mtaa-api.herokuapp.com
paths:
  "/{country}":
    get:
      description: Fetches all regions present in Tanzania and then return a response as json
      operationId: Tanzania-regions
      parameters:
        - description: Country name in lowercase eg (Tanzania)
          in: path
          name: country
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Successful response
      summary: Returns all regions present in Tanzania
      tags:
        - Tanzania regions
  "/{country}/{region}":
    get:
      description: Returns a post code and all districts in a specified region
      operationId: Districts-in-a-region
      parameters:
        - description: Country name in lowercase eg( tanzania)
          in: path
          name: country
          required: true
          schema:
            type: string
        - description: Name of the region eg (Mbeya)
          in: path
          name: region
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Successful response
        "404":
          description: Resource not Found
      summary: Returns all districts in region
      tags:
        - Districts in region
  "/{country}/{region}/{district}":
    get:
      description: Returns all wards in a  specified district and district postcode
      operationId: Wards-in-a-district
      parameters:
        - description: Country name in lowercase eg( tanzania)
          in: path
          name: country
          required: true
          schema:
            type: string
        - description: Name of the region eg (Mbeya)
          in: path
          name: region
          required: true
          schema:
            type: string
        - description: Name of the District eg (Rungwe)
          in: path
          name: district
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Successful response
        "404":
          description: Resource not Found
      summary: Returns all wards in a district
      tags:
        - Wards in a district
  "/{country}/{region}/{district}/{ward}":
    get:
      description: Returns all streets in a specified ward and ward postcode
      operationId: streets-in-a-ward
      parameters:
        - description: Country name in lowercase eg( tanzania)
          in: path
          name: country
          required: true
          schema:
            type: string
        - description: Name of the region eg (Mbeya)
          in: path
          name: region
          required: true
          schema:
            type: string
        - description: Name of the District eg (Rungwe)
          in: path
          name: district
          required: true
          schema:
            type: string
        - description: Name of the Ward eg (Kiwira)
          in: path
          name: ward
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Successful response
        "404":
          description: Resource not Found
      summary: Returns all streets in a ward
      tags:
        - Streets in a ward
  "/{country}/{region}/{district}/{ward}/{street}":
    get:
      description: Returns all neighborhood in a specified street
      operationId: neighborhood-in-a-street-
      parameters:
        - description: Country name in lowercase eg( tanzania)
          in: path
          name: country
          required: true
          schema:
            type: string
        - description: Name of the region eg (Mbeya)
          in: path
          name: region
          required: true
          schema:
            type: string
        - description: Name of the District eg (Rungwe)
          in: path
          name: district
          required: true
          schema:
            type: string
        - description: Name of the Ward eg (Kiwira)
          in: path
          name: ward
          required: true
          schema:
            type: string
        - description: Name of the Street eg (Ilundo)
          in: path
          name: street
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Successful response
        "404":
          description: Resource not Found
      summary: Returns all neighborhood in a street
      tags:
        - neighborhood in a street
