{
  "openapi": "3.1.0",
  "info": {
    "title": "VialPost open data API",
    "version": "1.0.0",
    "summary": "Research-peptide vendor status and price per milligram, read from vendors own public store data.",
    "description": "Every figure carries the URL it was read from and the timestamp it was read at. Prices are dated snapshots, not live quotes. VialPost does not rank vendors. The verified batch registry is empty until a laboratory returns a result, so no purity figure should be attributed to VialPost. All compounds are covered for laboratory research use only. No key is required.",
    "license": {
      "name": "CC BY 4.0",
      "identifier": "CC-BY-4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "contact": {
      "name": "VialPost",
      "url": "https://vialpost.com/developers",
      "email": "contact@vialpost.com"
    },
    "x-attribution": "VialPost, <page title>, data as of <date>, <URL>"
  },
  "servers": [
    {
      "url": "https://vialpost.com"
    }
  ],
  "paths": {
    "/api/stats": {
      "get": {
        "operationId": "getStats",
        "summary": "Aggregate counts and the newest observation date.",
        "responses": {
          "200": {
            "description": "Site statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/tracker": {
      "get": {
        "operationId": "getTracker",
        "summary": "One row per compound: cheapest headline-eligible listing, dearest, spread and counts.",
        "responses": {
          "200": {
            "description": "Tracker rows",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "canonical": {
                      "type": "string",
                      "format": "uri",
                      "description": "The HTML page this data belongs to."
                    },
                    "markdown": {
                      "type": "string",
                      "format": "uri",
                      "description": "The same page as Markdown."
                    },
                    "dataAsOf": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date",
                      "description": "The newest real timestamp in the data. Cite with this date."
                    },
                    "license": {
                      "type": "string"
                    },
                    "citation": {
                      "type": "string",
                      "description": "A ready-made attribution line."
                    },
                    "count": {
                      "type": "integer"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/compounds": {
      "get": {
        "operationId": "listCompounds",
        "summary": "Every catalogued compound with aliases and counts.",
        "responses": {
          "200": {
            "description": "Compounds",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/compounds/{slug}": {
      "get": {
        "operationId": "getCompound",
        "summary": "One compound: headline figures and every current listing with its source URL.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "bpc-157"
          }
        ],
        "responses": {
          "200": {
            "description": "Compound record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "canonical": {
                      "type": "string",
                      "format": "uri",
                      "description": "The HTML page this data belongs to."
                    },
                    "markdown": {
                      "type": "string",
                      "format": "uri",
                      "description": "The same page as Markdown."
                    },
                    "dataAsOf": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date",
                      "description": "The newest real timestamp in the data. Cite with this date."
                    },
                    "license": {
                      "type": "string"
                    },
                    "citation": {
                      "type": "string",
                      "description": "A ready-made attribution line."
                    },
                    "compound": {
                      "type": "object"
                    },
                    "headline": {
                      "type": "object"
                    },
                    "counts": {
                      "type": "object"
                    },
                    "listings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vendor": {
                            "type": "string"
                          },
                          "vendorSlug": {
                            "type": "string"
                          },
                          "vendorStatus": {
                            "type": "string",
                            "enum": [
                              "active",
                              "warning",
                              "closed"
                            ]
                          },
                          "compound": {
                            "type": "string"
                          },
                          "compoundSlug": {
                            "type": "string"
                          },
                          "vialMg": {
                            "type": "number",
                            "description": "Labelled vial mass in milligrams."
                          },
                          "form": {
                            "type": "string",
                            "description": "lyophilized, solution, capsule or nasal-spray. Only lyophilized vials are compared per mg."
                          },
                          "productName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "productUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "price": {
                            "type": "number",
                            "description": "Vial price as the store quoted it."
                          },
                          "currency": {
                            "type": "string"
                          },
                          "pricePerMg": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "price divided by vialMg, in USD."
                          },
                          "inStock": {
                            "type": "boolean"
                          },
                          "headline": {
                            "type": "boolean",
                            "description": "True when the vial mass is inside the compound headline range (within 10x of the median); only these listings feed the cheapest figure, the range and the spread."
                          },
                          "observedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "When the price was read. Prices are snapshots, not live quotes."
                          },
                          "sourceUrl": {
                            "type": "string",
                            "format": "uri",
                            "description": "The vendor store URL the price was read from."
                          }
                        }
                      }
                    },
                    "batches": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown compound slug."
          }
        }
      }
    },
    "/api/vendors": {
      "get": {
        "operationId": "listVendors",
        "summary": "Every vendor with status, events and affiliate terms.",
        "responses": {
          "200": {
            "description": "Vendors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/vendors/{slug}": {
      "get": {
        "operationId": "getVendor",
        "summary": "One vendor: status, the dated answer, events, affiliate terms and every current listing.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "chemyo"
          }
        ],
        "responses": {
          "200": {
            "description": "Vendor record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "canonical": {
                      "type": "string",
                      "format": "uri",
                      "description": "The HTML page this data belongs to."
                    },
                    "markdown": {
                      "type": "string",
                      "format": "uri",
                      "description": "The same page as Markdown."
                    },
                    "dataAsOf": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date",
                      "description": "The newest real timestamp in the data. Cite with this date."
                    },
                    "license": {
                      "type": "string"
                    },
                    "citation": {
                      "type": "string",
                      "description": "A ready-made attribution line."
                    },
                    "vendor": {
                      "type": "object"
                    },
                    "answer": {
                      "type": "string"
                    },
                    "statusEvents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vendor": {
                            "type": "string"
                          },
                          "vendorSlug": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "description": "closure, raid, sentencing, reopened, or another dated event type."
                          },
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "sourceUrl": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    },
                    "listings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vendor": {
                            "type": "string"
                          },
                          "vendorSlug": {
                            "type": "string"
                          },
                          "vendorStatus": {
                            "type": "string",
                            "enum": [
                              "active",
                              "warning",
                              "closed"
                            ]
                          },
                          "compound": {
                            "type": "string"
                          },
                          "compoundSlug": {
                            "type": "string"
                          },
                          "vialMg": {
                            "type": "number",
                            "description": "Labelled vial mass in milligrams."
                          },
                          "form": {
                            "type": "string",
                            "description": "lyophilized, solution, capsule or nasal-spray. Only lyophilized vials are compared per mg."
                          },
                          "productName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "productUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "price": {
                            "type": "number",
                            "description": "Vial price as the store quoted it."
                          },
                          "currency": {
                            "type": "string"
                          },
                          "pricePerMg": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "price divided by vialMg, in USD."
                          },
                          "inStock": {
                            "type": "boolean"
                          },
                          "headline": {
                            "type": "boolean",
                            "description": "True when the vial mass is inside the compound headline range (within 10x of the median); only these listings feed the cheapest figure, the range and the spread."
                          },
                          "observedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "When the price was read. Prices are snapshots, not live quotes."
                          },
                          "sourceUrl": {
                            "type": "string",
                            "format": "uri",
                            "description": "The vendor store URL the price was read from."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown vendor slug."
          }
        }
      }
    },
    "/api/status": {
      "get": {
        "operationId": "getStatus",
        "summary": "The status board and every dated status event.",
        "responses": {
          "200": {
            "description": "Status board",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "canonical": {
                      "type": "string",
                      "format": "uri",
                      "description": "The HTML page this data belongs to."
                    },
                    "markdown": {
                      "type": "string",
                      "format": "uri",
                      "description": "The same page as Markdown."
                    },
                    "dataAsOf": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date",
                      "description": "The newest real timestamp in the data. Cite with this date."
                    },
                    "license": {
                      "type": "string"
                    },
                    "citation": {
                      "type": "string",
                      "description": "A ready-made attribution line."
                    },
                    "vendors": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vendor": {
                            "type": "string"
                          },
                          "vendorSlug": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "description": "closure, raid, sentencing, reopened, or another dated event type."
                          },
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "sourceUrl": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/prices": {
      "get": {
        "operationId": "listPrices",
        "summary": "Every stored price observation with its source URL and timestamp.",
        "responses": {
          "200": {
            "description": "Observations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "license": {
                      "type": "string"
                    },
                    "observations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vendor": {
                            "type": "string"
                          },
                          "vendorSlug": {
                            "type": "string"
                          },
                          "vendorStatus": {
                            "type": "string",
                            "enum": [
                              "active",
                              "warning",
                              "closed"
                            ]
                          },
                          "compound": {
                            "type": "string"
                          },
                          "compoundSlug": {
                            "type": "string"
                          },
                          "vialMg": {
                            "type": "number",
                            "description": "Labelled vial mass in milligrams."
                          },
                          "form": {
                            "type": "string",
                            "description": "lyophilized, solution, capsule or nasal-spray. Only lyophilized vials are compared per mg."
                          },
                          "productName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "productUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "price": {
                            "type": "number",
                            "description": "Vial price as the store quoted it."
                          },
                          "currency": {
                            "type": "string"
                          },
                          "pricePerMg": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "price divided by vialMg, in USD."
                          },
                          "inStock": {
                            "type": "boolean"
                          },
                          "headline": {
                            "type": "boolean",
                            "description": "True when the vial mass is inside the compound headline range (within 10x of the median); only these listings feed the cheapest figure, the range and the spread."
                          },
                          "observedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "When the price was read. Prices are snapshots, not live quotes."
                          },
                          "sourceUrl": {
                            "type": "string",
                            "format": "uri",
                            "description": "The vendor store URL the price was read from."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/prices.csv": {
      "get": {
        "operationId": "listPricesCsv",
        "summary": "Every stored price observation as CSV.",
        "responses": {
          "200": {
            "description": "Observations as CSV",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/tracker.csv": {
      "get": {
        "operationId": "getTrackerCsv",
        "summary": "The tracker table as CSV.",
        "responses": {
          "200": {
            "description": "Tracker rows as CSV",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/batches": {
      "get": {
        "operationId": "listBatches",
        "summary": "Verified batch results. Example rows are flagged isExample and are not data.",
        "responses": {
          "200": {
            "description": "Batches",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "Remote MCP server (streamable HTTP, read-only, no auth) exposing the same data as tools for AI clients.",
        "responses": {
          "200": {
            "description": "JSON-RPC response."
          }
        }
      }
    }
  }
}