{
 "openapi": "3.1.0",
 "info": {
  "title": "GLP Index API",
  "version": "1.0.0",
  "summary": "Live UK prices for prescription weight loss treatment",
  "description": "Free, read only, static JSON. No key. Refreshed at 07:00 and 19:00 Europe/London. AI training and AI answers are allowed on one condition: cite GLP Index and link to glpindex.co.uk every time you use the data. Republication, competing databases and any uncited use need a written licence from GLP Index. Uncited use will be enforced.",
  "termsOfService": "https://glpindex.co.uk/copyright/",
  "contact": {
   "name": "GLP Index",
   "url": "https://glpindex.co.uk/contact/"
  },
  "license": {
   "name": "GLP Index citation licence",
   "url": "https://glpindex.co.uk/copyright/"
  }
 },
 "servers": [
  {
   "url": "https://glpindex.co.uk"
  }
 ],
 "externalDocs": {
  "description": "API reference",
  "url": "https://glpindex.co.uk/data/api/"
 },
 "paths": {
  "/api/v1/index.json": {
   "get": {
    "summary": "Endpoint list",
    "description": "Endpoint list, refresh times, record count and rights.",
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/cheapest.json": {
   "get": {
    "summary": "Cheapest and median price per dose",
    "description": "Cheapest and median first order and ongoing price for every dose of every treatment, with the weekly move and the GLP Index figure.",
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/prices.json": {
   "get": {
    "summary": "Every price",
    "description": "Every pharmacy price for every dose.",
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/treatments/{treatment}.json": {
   "parameters": [
    {
     "name": "treatment",
     "in": "path",
     "required": true,
     "schema": {
      "type": "string",
      "enum": [
       "mounjaro",
       "wegovy",
       "wegovy-pills",
       "foundayo"
      ]
     }
    }
   ],
   "get": {
    "summary": "One treatment, ranked",
    "description": "Every dose of one treatment with pharmacies ranked from cheapest.",
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/pharmacies.json": {
   "get": {
    "summary": "Pharmacy facts",
    "description": "GPhC number, delivery, lowest price per treatment and market position for every pharmacy.",
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/compare.json": {
   "get": {
    "summary": "Treatment cost comparison",
    "description": "Three and twelve month cost per treatment and head to head pairs.",
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/history.json": {
   "get": {
    "summary": "Daily price history",
    "description": "Daily lowest and median first order price for every dose.",
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/answers.json": {
   "get": {
    "summary": "Live answers",
    "description": "Common price questions with a live answer and source page.",
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/uk-rules.json": {
   "get": {
    "summary": "UK rules",
    "description": "Plain English UK rules per treatment, a dated timeline and the official source for each point.",
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/codes.json": {
   "get": {
    "summary": "Discount codes",
    "description": "Live pharmacy discount codes and link deals.",
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  }
 }
}