Cortex - NewsPlanetAI

Cortex - NewsPlanetAI · GPT Actions

News API

API for retrieving news based on different criteria such as category, headline, location, and timestamp.

  • GET /searchfuzzySearchArticles

    Perform a fuzzy search in news articles

  • GET /categorygetNewsByCategory

    Get news by category

  • GET /headlinegetNewsByHeadline

    Get news by headline keyword

  • GET /locationgetNewsByLocation

    Get news by location

  • GET /timestampgetNewsByTimestamp

    Get news by timestamp

  • GET /summarygetSuperSummary

    Get the super summary

  • GET /top-headlinesgetTopHeadlines

    Get all news articles marked as top headlines

  • GET /latest-soundcloud-trackgetLatestSoundCloudTrack

    Retrieve the latest SoundCloud track information

原始 API 定义
{
  "openapi": "3.1.0",
  "info": {
    "title": "News API",
    "description": "API for retrieving news based on different criteria such as category, headline, location, and timestamp.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://newsplanetai.com/dailyapi"
    }
  ],
  "paths": {
    "/search": {
      "get": {
        "description": "Perform a fuzzy search in news articles",
        "operationId": "fuzzySearchArticles",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "The search query for fuzzy matching",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "field",
            "in": "query",
            "description": "The field to search in (e.g., 'summary', 'headline')",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threshold",
            "in": "query",
            "description": "The threshold for fuzzy matching (default: 60)",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 60
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NewsItem"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/category": {
      "get": {
        "description": "Get news by category",
        "operationId": "getNewsByCategory",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "description": "The category to filter news",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NewsItem"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/headline": {
      "get": {
        "description": "Get news by headline keyword",
        "operationId": "getNewsByHeadline",
        "parameters": [
          {
            "name": "keyword",
            "in": "query",
            "description": "The keyword to search in headlines",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NewsItem"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/location": {
      "get": {
        "description": "Get news by location",
        "operationId": "getNewsByLocation",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "description": "The location to filter news",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NewsItem"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/timestamp": {
      "get": {
        "description": "Get news by timestamp",
        "operationId": "getNewsByTimestamp",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "The date to filter news (format YYYY-MM-DD)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NewsItem"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/summary": {
      "get": {
        "description": "Get the super summary",
        "operationId": "getSuperSummary",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/top-headlines": {
      "get": {
        "description": "Get all news articles marked as top headlines",
        "operationId": "getTopHeadlines",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NewsItem"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latest-soundcloud-track": {
      "get": {
        "description": "Retrieve the latest SoundCloud track information",
        "operationId": "getLatestSoundCloudTrack",
        "responses": {
          "200": {
            "description": "Successful response with the latest track information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "published": {
                      "type": "string"
                    },
                    "link": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No tracks found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "NewsItem": {
        "type": "object",
        "properties": {
          "headline": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "link": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "coordinates": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "top_headline": {
            "type": "boolean"
          }
        }
      }
    }
  }
}