{
 "openapi": "3.1.0",
 "info": {
  "title": "Wicketry price record",
  "version": "1.0.0",
  "description": "Read-only files behind wicketry.com: a nightly, dated record of software list prices read from the vendors' own pages. Every figure is what the page showed on the day, in the market read; nothing is converted, estimated or edited after the fact. Data licence: CC BY 4.0 \u2014 attribution is satisfied by a link to wicketry.com. How to cite: https://wicketry.com/data-for-agents",
  "license": {
   "name": "CC BY 4.0",
   "identifier": "CC-BY-4.0"
  },
  "contact": {
   "email": "hello@wicketry.com",
   "url": "https://wicketry.com/support"
  }
 },
 "servers": [
  {
   "url": "https://wicketry.com"
  }
 ],
 "paths": {
  "/data/wicketry-record.json": {
   "get": {
    "summary": "The append-only observation log",
    "description": "One key per vendor; each value is that vendor's reads, oldest first.",
    "responses": {
     "200": {
      "description": "the file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": {
          "type": "array",
          "items": {
           "type": "object",
           "description": "One read of one vendor's pricing page.",
           "properties": {
            "ts": {
             "type": "integer",
             "description": "Unix timestamp of the read (UTC)"
            },
            "day": {
             "type": "string",
             "format": "date",
             "description": "the read's date"
            },
            "url": {
             "type": "string",
             "description": "the vendor page that was read"
            },
            "status": {
             "type": "integer",
             "description": "HTTP status the page answered with"
            },
            "sha256": {
             "type": "string",
             "description": "hash of the content read"
            },
            "tokens": {
             "type": "array",
             "items": {
              "type": "string"
             },
             "description": "the raw price strings the page showed, exactly as displayed"
            },
            "note": {
             "type": "string"
            },
            "changed_vs_prev": {
             "type": "boolean",
             "description": "whether this read differed from the previous one"
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/data/wicketry-record.csv": {
   "get": {
    "summary": "The observation log as a table",
    "description": "Columns: vendor, day, http_status, note, price_strings_seen. One row per vendor per day.",
    "responses": {
     "200": {
      "description": "the file",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  },
  "/record-latest.json": {
   "get": {
    "summary": "The latest read per vendor",
    "description": "One key per vendor; regenerated on the server every morning.",
    "responses": {
     "200": {
      "description": "the file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": {
          "type": "object",
          "description": "The latest read for one vendor.",
          "properties": {
           "name": {
            "type": "string"
           },
           "cat": {
            "type": "string",
            "description": "category"
           },
           "since": {
            "type": "string",
            "format": "date",
            "description": "first day in the record"
           },
           "obs": {
            "type": "integer",
            "description": "observations held"
           },
           "changes": {
            "type": "integer",
            "description": "confirmed changes held"
           },
           "prices": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "description": "price strings from the latest successful read, as displayed"
           },
           "prices_day": {
            "type": "string",
            "format": "date",
            "description": "the day those prices were read"
           },
           "url": {
            "type": "string"
           },
           "status": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/record-stats.json": {
   "get": {
    "summary": "The counts the site prints",
    "description": "Vendors tracked, observations held, confirmed changes, and the last day read.",
    "responses": {
     "200": {
      "description": "the file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "vendors": {
           "type": "integer"
          },
          "observations": {
           "type": "integer"
          },
          "changes": {
           "type": "integer"
          },
          "walled_today": {
           "type": "integer"
          },
          "last_day": {
           "type": "string",
           "format": "date"
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
}