{
  "openapi": "3.0.1",
  "info": {
    "title": "Google News API – Monitoring, Pay Only for New Articles",
    "description": "Monitor Google News for keywords, topics and publishers. One record per article across queries and countries, charges only for articles new since your last run, publisher URLs on request and a report of what may be missing.",
    "version": "0.1",
    "x-build-id": "7yGsgDHlBhTO9wjzS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datarelay~google-news-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datarelay-google-news-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/datarelay~google-news-api/runs": {
      "post": {
        "operationId": "runs-sync-datarelay-google-news-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/datarelay~google-news-api/run-sync": {
      "post": {
        "operationId": "run-sync-datarelay-google-news-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "What to search for, with Google News operators if you like: `tesla`, `\"electric truck\"`, `tesla OR rivian`, `tesla -musk`. An article found by several queries is delivered and charged once. Give at least one of: queries, topics, sites. To read only topics or only publishers, leave this empty.",
            "items": {
              "type": "string"
            }
          },
          "topics": {
            "title": "Topics",
            "type": "array",
            "description": "Google News sections of each locale. `TOP` is the front page. Topic feeds have 30–70 articles chosen by Google.",
            "items": {
              "type": "string",
              "enum": [
                "TOP",
                "WORLD",
                "NATION",
                "BUSINESS",
                "TECHNOLOGY",
                "ENTERTAINMENT",
                "SPORTS",
                "SCIENCE",
                "HEALTH"
              ],
              "enumTitles": [
                "Top stories",
                "World",
                "Nation",
                "Business",
                "Technology",
                "Entertainment",
                "Sports",
                "Science",
                "Health"
              ]
            }
          },
          "sites": {
            "title": "Publishers (domains)",
            "type": "array",
            "description": "Publisher domains, e.g. `reuters.com`. Alone: the latest from the publisher. With queries: every query is searched in every publisher.",
            "items": {
              "type": "string"
            }
          },
          "locales": {
            "title": "Locales (language-country)",
            "type": "array",
            "description": "Google News editions to read, e.g. `en-US`, `en-GB`, `pl-PL`, `de-DE`. The same article in several editions is delivered once. OUTPUT.otherLanguage lists editions that Google answered in another language (an edition it does not have).",
            "default": [
              "en-US"
            ],
            "items": {
              "type": "string"
            }
          },
          "feedUrls": {
            "title": "Google News URLs",
            "type": "array",
            "description": "Addresses of topics or publishers from news.google.com: `/topics/…`, `/publications/…`. A URL with `hl`, `gl` and `ceid` is read in that edition, otherwise in every locale. `/stories/…` (Full Coverage) pages are accepted, but Google answers most of them with \"This feed is not available\": see `OUTPUT.notAvailable`.",
            "items": {
              "type": "string"
            }
          },
          "excludeSites": {
            "title": "Exclude publishers (domains)",
            "type": "array",
            "description": "Articles from these domains and their subdomains are not delivered or charged, e.g. `example.com`.",
            "items": {
              "type": "string"
            }
          },
          "timeRange": {
            "title": "Time range",
            "pattern": "^(any|[1-9][0-9]{0,3}[hdyHDY])$",
            "type": "string",
            "description": "How old articles may be: `any`, or a number with `h`, `d` or `y`, e.g. `6h`, `1d`, `7d`, `90d`, `1y`. Ignored when `from` or `to` is set.",
            "default": "7d"
          },
          "from": {
            "title": "From",
            "type": "string",
            "description": "Start of the period: `YYYY-MM-DD` (UTC) or an ISO 8601 date and time. Overrides the time range."
          },
          "to": {
            "title": "To",
            "type": "string",
            "description": "End of the period, inclusive: `YYYY-MM-DD` (UTC) or an ISO 8601 date and time. Overrides the time range."
          },
          "splitByDay": {
            "title": "Search each day separately",
            "type": "boolean",
            "description": "Google returns at most ~100 results per search. With `from`, every day of the period is searched on its own. With a time range of up to 92 days, a search that reaches the limit is read again day by day. No extra charge per search.",
            "default": true
          },
          "maxArticles": {
            "title": "Max articles per run",
            "minimum": 0,
            "type": "integer",
            "description": "Newest first. 0 = no limit. With monitoring, articles over the limit stay new for the next run.",
            "default": 100
          },
          "maxArticlesPerQuery": {
            "title": "Max articles per query",
            "minimum": 0,
            "type": "integer",
            "description": "Per query or topic in each locale. 0 = no limit.",
            "default": 0
          },
          "onlyNew": {
            "title": "Only new articles",
            "type": "boolean",
            "description": "Monitoring: deliver and charge only articles not delivered before under the sync key. For scheduled runs. Setting a sync key turns this on.",
            "default": false
          },
          "syncKey": {
            "title": "Sync key",
            "type": "string",
            "description": "Name of the memory of delivered articles, kept in your account (key-value store `google-news-sync-<key>`). You can change queries under the same key: articles already delivered are not charged again. Letters, digits and dashes, at most 40. An article not found for 90 days is forgotten; the memory holds the latest 200,000."
          },
          "syncReset": {
            "title": "Reset the memory",
            "type": "boolean",
            "description": "Forget the delivered articles of the sync key before this run.",
            "default": false
          },
          "resolveUrls": {
            "title": "Resolve publisher URLs",
            "type": "boolean",
            "description": "Google News gives only its own redirect link (`googleNewsUrl`). This adds the publisher's address in `url`: a paid add-on per resolved URL, charged only when it succeeds, and slower (two requests per article). `urlStatus` says what happened.",
            "default": false
          },
          "extraReadsAtCap": {
            "title": "Extra reads of searches at the limit",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "A search still at Google's limit is read this many more times, from other sessions. Google's list depends on the IP that asks, so this can find more articles. Mostly useful for a time range of one day or less. No extra charge per read.",
            "default": 0
          },
          "spikeFactor": {
            "title": "Mention spike: times the usual level",
            "minimum": 0,
            "type": "integer",
            "description": "With a sync key: report a query whose articles today are at least this many times its daily average of the last 14 days (needs 3 days of history). In `OUTPUT.spikes`, the digest and Slack. 0 = off.",
            "default": 3
          },
          "spikeMinArticles": {
            "title": "Mention spike: at least this many articles",
            "minimum": 1,
            "type": "integer",
            "description": "Fewer articles today are never a spike.",
            "default": 5
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL",
            "type": "string",
            "description": "Send the digest to Slack: an incoming webhook, `https://hooks.slack.com/services/…`. Sent only when a run has new articles or a spike. Stored encrypted."
          },
          "maxRunSecs": {
            "title": "Max run time (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Stop early and keep what was delivered. 0 = until the run's timeout.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy (default) keeps runs reliable. With residential proxies selected, the run starts on datacenter proxies and uses residential only after Google blocks a request.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}