{
  "openapi": "3.0.1",
  "info": {
    "title": "News API - Social Engagement, Trending Stories, NewsWhip",
    "description": "Search news articles, YouTube videos and Facebook posts with real-time social engagement and predicted interactions from your own NewsWhip API key: trending stories by region, topic, city or publisher, history from 2018, top Facebook pages, engagement stats and syndication pickups. Read only.",
    "version": "0.1",
    "x-build-id": "ybxpsnr5TBfvuwa6o"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~news-api-social-engagement-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-news-api-social-engagement-data",
        "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/nabeelbaghoor~news-api-social-engagement-data/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-news-api-social-engagement-data",
        "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/nabeelbaghoor~news-api-social-engagement-data/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-news-api-social-engagement-data",
        "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": {
          "mode": {
            "title": "What to read",
            "enum": [
              "region",
              "search",
              "publisher",
              "local",
              "articles",
              "articlesByHrefs",
              "fbPosts",
              "fbInfluencers",
              "stats",
              "syndicatedArticles"
            ],
            "type": "string",
            "description": "Top stories by region and topic needs nothing else, so it is the default. The first four modes are the Quick Start API (last 168 hours, up to 500 records a call). Article and video search, URL lookup, Facebook posts, Facebook influencers and engagement statistics are the Historical API (from 2018). Syndicated pickups needs a Syndication subscription.",
            "default": "region"
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "Top stories by region. A region or country name in English from the provider Regions list, such as World, United States, Ireland or Germany.",
            "default": "World"
          },
          "category": {
            "title": "Topic",
            "type": "string",
            "description": "Top stories by region. A topic name in English from the provider Topics list, such as All, Politics, Tech, Business, Sports or Entertainment.",
            "default": "All"
          },
          "timePeriodHours": {
            "title": "Time period (hours)",
            "minimum": 1,
            "maximum": 168,
            "type": "integer",
            "description": "Region, publisher and local stories. Read stories published within the last 1 to 168 hours.",
            "default": 24
          },
          "query": {
            "title": "Keywords",
            "type": "string",
            "description": "Keyword search: the keywords or phrase to find, such as electric cars. Historical modes: used as the single filter when no filters are set, searching headline, summary and authors."
          },
          "publisher": {
            "title": "Publisher domain",
            "type": "string",
            "description": "Publisher stories. A domain or subdomain, such as nytimes.com or blog.newswhip.com."
          },
          "city": {
            "title": "City or local region",
            "type": "string",
            "description": "Local stories. A local region from the provider list, such as Seattle, WA, New York, NY, London, Toronto or Hamburg-Schleswig-Holstein."
          },
          "filters": {
            "title": "Filters (Lucene)",
            "type": "array",
            "description": "Historical modes and syndicated pickups. Lucene filter strings on documented fields: headline, summary, authors, country_code, region_code, language, categories (topic IDs), publisher, domain, domains, href, siteStructure; for Facebook posts also page_id, page_name, external_link, fb_story. Separate entries are joined with OR, so put AND inside one entry. Up to 20 filters.",
            "items": {
              "type": "string"
            }
          },
          "from": {
            "title": "From",
            "type": "string",
            "description": "Historical modes. Start date as YYYY-MM-DD, an ISO date and time, or epoch milliseconds, from 2018-01-01. Leave both dates empty for the provider default of the last 7 days. Searches over more than 7 days are read in 7 day windows, newest first."
          },
          "to": {
            "title": "To",
            "type": "string",
            "description": "Historical modes. End date in the same formats. Defaults to now."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Historical modes. A two letter ISO 639-1 code, such as en, de, fr or es. Empty means any language."
          },
          "articleContentType": {
            "title": "Content type",
            "enum": [
              "stories",
              "youtube"
            ],
            "type": "string",
            "description": "Article and video search. Web stories or YouTube videos.",
            "default": "stories"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "default",
              "fb_total_engagement",
              "fb_tw_overperforming",
              "fb_overperforming",
              "tw_overperforming",
              "predicted_interactions",
              "twitter",
              "linkedin",
              "fb_tw_and_li",
              "fb_tw_li_and_pi",
              "nw_max_score",
              "created_at",
              "yt_likes",
              "yt_views",
              "yt_comments",
              "fb_likes",
              "fb_shares",
              "fb_comments",
              "fb_loves",
              "fb_wows",
              "fb_hahas",
              "fb_sads",
              "fb_angrys",
              "match_rate",
              "nw_score"
            ],
            "type": "string",
            "description": "Article, Facebook post and syndication searches, always descending. Default is velocity (nw_max_score) for ranges up to 25 hours, otherwise overperformance. Web stories: fb_total_engagement, fb_tw_overperforming, fb_overperforming, tw_overperforming, predicted_interactions, twitter, linkedin, fb_tw_and_li, fb_tw_li_and_pi, nw_max_score, created_at. YouTube: yt_likes, yt_views, yt_comments, created_at. Facebook posts: nw_max_score, fb_overperforming, fb_total_engagement, created_at and each reaction. Syndication adds match_rate and nw_score.",
            "default": "default"
          },
          "findRelated": {
            "title": "Group related stories",
            "type": "boolean",
            "description": "Article search, web stories. Collapse stories with near-identical headlines into the relatedStories list of the best match.",
            "default": true
          },
          "videoOnly": {
            "title": "Stories with video only",
            "type": "boolean",
            "description": "Article search, web stories. Keep only stories with a detected video.",
            "default": false
          },
          "searchFullText": {
            "title": "Search full article text",
            "type": "boolean",
            "description": "Article search. Match keywords against the full article text, not only headline, summary and authors.",
            "default": false
          },
          "defaultFields": {
            "title": "Keyword fields",
            "type": "array",
            "description": "Article search, Facebook posts and statistics. Up to 3 fields that plain keywords search. Articles default to headline, summary and authors; Facebook posts to page_name and external_link.",
            "items": {
              "type": "string"
            }
          },
          "fbContentType": {
            "title": "Facebook content type",
            "enum": [
              "all",
              "all_video",
              "embedded_video",
              "native_video",
              "live_video",
              "link",
              "photo",
              "status",
              "branded_content"
            ],
            "type": "string",
            "description": "Facebook posts. All posts, or only videos, embedded, native or live video, links, photos, status updates or branded content.",
            "default": "all"
          },
          "hrefs": {
            "title": "Article URLs",
            "type": "array",
            "description": "URL lookup. Full article URLs to fetch with their engagement; sent 5 per call. A URL the provider does not hold becomes an uncharged row.",
            "items": {
              "type": "string"
            }
          },
          "statsAggregateBy": {
            "title": "Aggregate statistics by",
            "enum": [
              "publisher",
              "domains",
              "domain",
              "language",
              "authors",
              "categories",
              "country_code"
            ],
            "type": "string",
            "description": "Engagement statistics. Group matching content by publisher, all domain permutations (domains), exact domain, language, authors, topic (categories) or country.",
            "default": "publisher"
          },
          "statsSortBy": {
            "title": "Sort statistics by",
            "enum": [
              "fb_total.count",
              "fb_total.min",
              "fb_total.max",
              "fb_total.avg",
              "fb_total.sum",
              "fb_total.sum_of_squares",
              "fb_total.variance",
              "fb_total.std_deviation",
              "twitter.count",
              "twitter.min",
              "twitter.max",
              "twitter.avg",
              "twitter.sum",
              "twitter.sum_of_squares",
              "twitter.variance",
              "twitter.std_deviation",
              "pinterest.count",
              "pinterest.min",
              "pinterest.max",
              "pinterest.avg",
              "pinterest.sum",
              "pinterest.sum_of_squares",
              "pinterest.variance",
              "pinterest.std_deviation",
              "linkedin.count",
              "linkedin.min",
              "linkedin.max",
              "linkedin.avg",
              "linkedin.sum",
              "linkedin.sum_of_squares",
              "linkedin.variance",
              "linkedin.std_deviation"
            ],
            "type": "string",
            "description": "Engagement statistics. A network (fb_total, twitter, pinterest, linkedin) and a statistic (count, min, max, avg, sum, sum_of_squares, variance, std_deviation).",
            "default": "fb_total.sum"
          },
          "syndicationFilters": {
            "title": "Source article filters",
            "type": "array",
            "description": "Syndicated pickups. Lucene filters on your own source articles: headline, authors, summary, language, syndication_story_id.",
            "items": {
              "type": "string"
            }
          },
          "syndicationTopicsFilter": {
            "title": "Source topics filter",
            "type": "string",
            "description": "Syndicated pickups. A Lucene filter on your syndication topics (_type and _value)."
          },
          "minMatchRate": {
            "title": "Minimum match rate",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Syndicated pickups. Lowest text match percentage. The provider defaults to 10."
          },
          "maxMatchRate": {
            "title": "Maximum match rate",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Syndicated pickups. Highest text match percentage. The provider defaults to 100."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "The most rows this run returns and charges for. One call returns up to 500 records on Quick Start routes and 5,000 on Historical routes; longer Historical ranges are read window by window.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Pacing. The provider allows 100 calls per rolling 5 minutes and 5 a second; raise this only if your contract allows more.",
            "default": 18
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own NewsWhip API key, issued with your API subscription. Stored as a secret. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}