Skip to main content

News API

News API provides comprehensive access to breaking news headlines and articles from thousands of sources worldwide, enabling businesses to integrate real-time news data, track media coverage, monitor industry trends, and build news-driven applications with reliable and up-to-date information.

News API icon

Power end-to-end data operations for your News API API with Nexla. Our bi-directional News API connector is purpose-built for News API, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to News API or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your News API workflows fast, secure, and fully governed.

Features

Type: API

SourceDestination

  • Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
  • Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
  • API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
  • Request optimization with intelligent batching, retry, and caching to minimize API calls and costs

Prerequisites

Before creating a News API credential, you need to obtain your API key from your News API account. News API uses API key authentication for all API requests, with the API key sent in the X-Api-Key header.

To obtain your News API key, follow these steps:

  1. Sign in to your News API account, or create a new account at News API.

  2. Navigate to your account dashboard or settings section.

  3. Look for the API Keys or API section in your account settings or dashboard.

  4. If you don't have an API key yet, click Get API Key or Generate API Key to create a new API key.

  5. Copy the API key immediately after it's generated, as it may not be accessible again after you navigate away from the page.

  6. Store the API key securely, as you will need it to configure your Nexla credential. The API key is sensitive information and should be kept confidential.

The API key is sent in the X-Api-Key header for all API requests to the News API. The API key authenticates your requests and grants access to News API resources based on your account plan and rate limits. If your API key is compromised, you should immediately regenerate it in your News API account settings and update your credential. For detailed information about obtaining API keys, API authentication, and available endpoints, refer to the News API documentation.

Authenticate

Credentials required

FieldRequiredSecretDescription
API KeyYesYesAuthenticating with the News API is accomplished through the use of an API key. Check out https://newsapi.org/docs/authentication for requesting API token.

Create a credential in Nexla

  1. After selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

New Credential Overlay – News API

NewsAPICred.png
  1. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

  2. Enter your News API key in the API Key field. This is the API key you obtained from your News API account settings (API Keys section). The API key is sent in the X-Api-Key header for all API requests to the News API. The API key is sensitive information and must be kept confidential.

    Your News API key can be found in your News API account settings under the API Keys section. The API key is sent in the X-Api-Key header for all API requests to the News API.

    If your API key is compromised, you should immediately regenerate it in your News API account settings and update your credential. The API key provides access to your News API account and should be treated as sensitive information. Keep your API key secure and do not share it publicly.

    For detailed information about obtaining API keys, API authentication, and available endpoints, see the News API documentation.

  3. Click the Save button at the bottom of the overlay. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation.

Use as a data source

To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the News API connector tile, then select the credential that will be used to connect to your News API account, and click Next; or, create a new News API credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common News API endpoints. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.

Get Breaking News Headlines For a Country

This endpoint template fetches top and breaking headlines for a specific category in a country from the News API. Use this template when you need to retrieve current news headlines filtered by country and category, such as business news from the US or technology news from the UK.

  • Enter the country code in the Country (or 2 letter code) field. This should be the 2-letter ISO 3166-1 country code (e.g., us for United States, gb for United Kingdom, ca for Canada). You can select from the dropdown or enter a custom 2-letter country code. The country code determines which country's headlines will be retrieved.
  • Enter the category code in the Category field. Available categories include business, entertainment, general, health, science, sports, and technology. You can select from the dropdown or enter a custom category code. The category determines which type of headlines will be retrieved.

This endpoint retrieves top and breaking headlines for the specified country and category. The endpoint uses incrementing page-based pagination to handle large datasets efficiently. Nexla will automatically fetch subsequent pages of data by incrementing the page number. The endpoint returns up to 100 articles per page by default.

Country codes must be valid 2-letter ISO 3166-1 codes. Category codes must be valid News API category values. For detailed information about available countries, categories, pagination, and API usage limits, see the News API top headlines documentation.

Get Breaking News Headlines by Keyword Search

This endpoint template fetches top and breaking headlines that match a keyword search from the News API. Use this template when you need to retrieve current news headlines filtered by keywords, such as headlines about "artificial intelligence" or "climate change". Articles are sorted by the earliest date published first.

  • Enter your search query in the Query String field. This should be the keyword or phrase you want to search for in headlines (e.g., artificial intelligence, climate change, technology). The query string is used to filter headlines that match your search criteria.

This endpoint retrieves top and breaking headlines that match the keyword search. The endpoint uses incrementing page-based pagination to handle large datasets efficiently. Nexla will automatically fetch subsequent pages of data by incrementing the page number. The endpoint returns up to 100 articles per page by default. Articles are sorted by the earliest date published first.

For detailed information about query syntax, pagination, and API usage limits, see the News API top headlines documentation.

Search for Articles by Keyword/Query

This endpoint template searches for articles using a keyword or query string from the News API. Use this template when you need to search across all available articles (not just top headlines) for specific keywords or topics, such as searching for all articles about "machine learning" or "renewable energy".

  • Enter your search query in the Query String field. This should be the keyword or phrase you want to search for in articles (e.g., machine learning, renewable energy, startup funding). The query string is used to filter articles that match your search criteria.

This endpoint searches across all available articles (not just top headlines) for articles matching the keyword search. The endpoint uses incrementing page-based pagination to handle large datasets efficiently. Nexla will automatically fetch subsequent pages of data by incrementing the page number. The endpoint returns up to 100 articles per page by default.

For detailed information about query syntax, pagination, date filtering, and API usage limits, see the News API everything endpoint documentation.

Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.

Manual configuration

News API data sources can also be manually configured to ingest data from any valid News API endpoint, including endpoints not covered by the pre-built templates, chained API calls, or custom request parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, date/time and lookup macros, path to data, metadata, and request headers.

News API endpoints use the base URL https://newsapi.org/v2, with paths such as /top-headlines or /everything (e.g., https://newsapi.org/v2/top-headlines?country=us&category=business). For the Response Data Path, use $.articles[*] to extract individual articles from the response. News API uses incrementing page-based pagination, with a page parameter starting at 1 and a pageSize parameter for page size, returning up to 100 articles per page by default.

Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new News API data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.