新闻合订本

新闻合订本 · GPT 작업

ChinaBriefing Search And Today API

  • GET /api/gpt/searchSearch the relevant news by your query news
  • GET /api/gpt/todayGet Today Key News
원본 API 스키마
{
  "openapi": "3.0.0",
  "info": {
    "title": "ChinaBriefing Search And Today API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://chinabriefing.co"
    }
  ],
  "paths": {
    "/api/gpt/search": {
      "get": {
        "summary": "Search the relevant news by your query news",
        "operationId": "search",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Search query string, e.g. news title, keywords etc"
          },
          {
            "in": "query",
            "name": "years",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated years to filter the news by year"
          }
        ],
        "responses": {
          "200": {
            "description": "Search results returned successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "result": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SearchResult"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/gpt/today": {
      "get": {
        "summary": "Get Today Key News",
        "operationId": "today",
        "parameters": [
          {
            "in": "query",
            "name": "lang",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "should always use \"zh\" since only serve for Chinese."
          }
        ],
        "responses": {
          "200": {
            "description": "Today news returned successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "news": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SearchResult"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SearchResult": {
        "type": "object",
        "required": [
          "nid",
          "date",
          "title",
          "content",
          "sourceURL"
        ],
        "properties": {
          "nid": {
            "type": "string",
            "description": "Goblal Unique News ID"
          },
          "title": {
            "type": "string",
            "description": "News title"
          },
          "content": {
            "type": "string",
            "description": "News detail content"
          },
          "sourceURL": {
            "type": "string",
            "format": "uri",
            "description": "The source URL of the news, use can click to learn more"
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "News report date"
          }
        }
      }
    }
  }
}