{
  "openapi": "3.0.3",
  "info": {
    "title": "今日油价",
    "description": "可查询全国范围内31个省份的具体油价，根据国家公布的价格，每日凌晨7点同步更新。它适用于车主服务APP、公众号/小程序、汽车网站等，帮助用户轻松掌握最新油价动态。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/138-49": {
      "x-pointCode": 49,
      "x-mode": "mapping",
      "x-read-timeout": 5,
      "x-connect-timeout": 5,
      "post": {
        "summary": "查询行情",
        "description": "查询油价的涨跌幅、最新更新日期、下一次更新日期",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "next_change_time": {
                              "type": "string",
                              "description": "下一次油价调整时间"
                            },
                            "before_change_time": {
                              "type": "string",
                              "description": "最近一次油价调整时间"
                            },
                            "prov": {
                              "type": "string",
                              "description": "省"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其余为失败"
                            },
                            "p0": {
                              "type": "object",
                              "properties": {
                                "price": {
                                  "type": "string",
                                  "description": "当前价格"
                                },
                                "change_before_price": {
                                  "type": "string",
                                  "description": "最近一次价格"
                                },
                                "change": {
                                  "type": "string",
                                  "description": "涨跌幅"
                                },
                                "change_percent": {
                                  "type": "string",
                                  "description": "涨跌率"
                                }
                              }
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "138_49_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "prov": {
                    "type": "string",
                    "description": "省名，比如北京，广西"
                  }
                },
                "required": [
                  "prov"
                ]
              }
            }
          }
        }
      }
    },
    "/138-46": {
      "x-pointCode": 46,
      "x-mode": "mapping",
      "x-read-timeout": 5,
      "x-connect-timeout": 5,
      "post": {
        "summary": "查询油价",
        "description": "通过省名查询最新油价,支持全国范围内31个省份，",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "ret_code": {
                              "type": "number",
                              "description": "0：成功，计费\n其他：失败，不计费"
                            },
                            "list": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "prov": {
                                    "type": "string"
                                  },
                                  "p90": {
                                    "type": "string",
                                    "description": "90号油"
                                  },
                                  "p0": {
                                    "type": "string",
                                    "description": "0号油"
                                  },
                                  "p95": {
                                    "type": "string",
                                    "description": "95号油"
                                  },
                                  "p97": {
                                    "type": "string",
                                    "description": "97号油"
                                  },
                                  "p98": {
                                    "type": "string",
                                    "description": "98号油"
                                  },
                                  "p89": {
                                    "type": "string",
                                    "description": "89号油"
                                  },
                                  "p92": {
                                    "type": "string",
                                    "description": "92号油"
                                  },
                                  "p93": {
                                    "type": "string",
                                    "description": "93号油"
                                  },
                                  "ct": {
                                    "type": "string",
                                    "description": "更新时间"
                                  }
                                }
                              }
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "138_46_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "prov": {
                    "type": "string",
                    "description": "省名，比如北京，广西"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    },
    "schemas": {
      "ShowapiResEnvelope": {
        "type": "object",
        "description": "ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）",
        "properties": {
          "showapi_res_code": {
            "type": "integer",
            "description": "API 返回的状态码"
          },
          "showapi_res_error": {
            "type": "string",
            "description": "API 返回的错误信息"
          },
          "showapi_res_id": {
            "type": "string",
            "description": "API 请求的唯一标识"
          },
          "showapi_fee_num": {
            "type": "integer",
            "description": "API 调用计费次数"
          }
        }
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apiGateway/view/138?tab=book"
  },
  "x-apiCode": "138",
  "x-is-own": false,
  "x-is-op": true
}