{
  "swagger": "2.0",
  "info": {
    "title": "Logimu product and shopping reads",
    "version": "1.0.0"
  },
  "host": "api.logimu.com",
  "basePath": "/v1",
  "schemes": [
    "https"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "LogimuKey": {
      "type": "apiKey",
      "in": "header",
      "name": "X-API-Key"
    }
  },
  "security": [
    {
      "LogimuKey": []
    }
  ],
  "paths": {
    "/product": {
      "get": {
        "operationId": "GetProduct",
        "tags": [
          "Product"
        ],
        "summary": "GetProduct",
        "parameters": [
          {
            "name": "asin",
            "in": "query",
            "description": "Amazon product ID.",
            "type": "string",
            "required": true
          },
          {
            "name": "country",
            "in": "query",
            "description": "Amazon marketplace code.",
            "type": "string",
            "enum": [
              "us",
              "uk",
              "de",
              "ca",
              "au",
              "fr",
              "it",
              "es",
              "jp",
              "mx",
              "br"
            ],
            "default": "us"
          },
          {
            "name": "mode",
            "in": "query",
            "description": "Read the stored record.",
            "type": "string",
            "enum": [
              "cache"
            ],
            "default": "cache",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful lookup.",
            "schema": {
              "$ref": "#/definitions/Product"
            }
          },
          "default": {
            "description": "API error. See the accompanying setup guide."
          }
        }
      }
    },
    "/shopping": {
      "get": {
        "operationId": "SearchProducts",
        "tags": [
          "Shopping"
        ],
        "summary": "SearchProducts",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Words or an exact ASIN.",
            "type": "string",
            "required": true
          },
          {
            "name": "country",
            "in": "query",
            "description": "Amazon marketplace code.",
            "type": "string",
            "enum": [
              "us",
              "uk",
              "de",
              "ca",
              "au",
              "fr",
              "it",
              "es",
              "jp",
              "mx",
              "br"
            ],
            "default": "us"
          },
          {
            "name": "group",
            "in": "query",
            "description": "Return a flat results array.",
            "type": "string",
            "enum": [
              "none"
            ],
            "default": "none",
            "required": true
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum rows to return.",
            "type": "integer",
            "minimum": 1,
            "maximum": 25,
            "default": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Successful lookup.",
            "schema": {
              "$ref": "#/definitions/Shopping"
            }
          },
          "default": {
            "description": "API error. See the accompanying setup guide."
          }
        }
      }
    }
  },
  "definitions": {
    "Listing": {
      "type": "object",
      "required": [
        "asin"
      ],
      "properties": {
        "asin": {
          "type": "string"
        },
        "title": {
          "type": "string",
          "x-nullable": true
        },
        "brand": {
          "type": "string",
          "x-nullable": true
        },
        "price": {
          "type": "number",
          "format": "double",
          "x-nullable": true
        },
        "review_count": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "price_observed_at": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "Product": {
      "allOf": [
        {
          "$ref": "#/definitions/Listing"
        },
        {
          "type": "object",
          "properties": {
            "currency": {
              "type": "string",
              "x-nullable": true
            }
          }
        }
      ]
    },
    "Shopping": {
      "type": "object",
      "required": [
        "results"
      ],
      "properties": {
        "query": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "total": {
          "type": "integer"
        },
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Listing"
          }
        }
      }
    }
  }
}
