The NewsAPI connector lets your AI agent act in each user's NewsAPI account. Each user connects their own NewsAPI API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 3 tools.
- Tools
- 3
- What they doRead · write · destructive
- 3 · 0 · 03 read0 write0 destructive
- Users sign in with
- API key
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the NewsAPI connection
In AgentKit > Connections, create a NewsAPI connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'newsapi'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize NewsAPI:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'newsapi_articles_search',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "newsapi"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize NewsAPI:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="newsapi_articles_search",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their NewsAPI credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolnewsapi_articles_searchSearch news and blog articles from over 150,000 sources by keyword, source, domain, date and language.Read-onlySearch All Articles
Search news and blog articles from over 150,000 sources by keyword, source, domain, date and language. Returns status, totalResults and articles with source, author, title, description, url, urlToImage, publishedAt and content (truncated to 200 characters). Use this to research a topic across all articles. Use newsapi_top_headlines_list for current breaking headlines. Set at least one of q, sources or domains.
Inputs
domainsstring- Comma-separated domains to restrict the search to. Example: bbc.co.uk,techcrunch.com.
exclude_domainsstring- Comma-separated domains to remove from the results. Example: engadget.com.
fromstring- Oldest article date and optional time, in ISO 8601. Defaults to the oldest your plan allows. Example: 2026-11-01.
languagestring- Two-letter ISO-639-1 language code. Defaults to all languages. Example: en.one of
ardeenesfrheitnlnoptrusvudzh pageinteger- Page number to return, starting at 1. Defaults to 1. Example: 1.
page_sizeinteger- Number of articles per page. Defaults to 100, maximum 100. Example: 100.
qstring- Keywords or phrase to search for in the title and body, up to 500 characters. Use quotes for an exact phrase, + for words that must appear, - for words that must not, and AND / OR / NOT with parentheses. Example: crypto AND (ethereum OR litecoin) NOT bitcoin.
search_instring- Fields to restrict the q search to, comma-separated: title, description, content. Defaults to all fields. Example: title,description.
sort_bystring- Sort order: relevancy (closest to q first), popularity (popular sources first) or publishedAt (newest first, the default). Example: publishedAt.one of
relevancypopularitypublishedAt sourcesstring- Comma-separated source IDs (maximum 20) to search. Get IDs from newsapi_sources_list. Example: bbc-news,the-verge.
tostring- Newest article date and optional time, in ISO 8601. Defaults to the newest your plan allows. Example: 2026-11-15T23:59:59.
newsapi_sources_listList the news sources available for top headlines, optionally filtered by category, language or country.Read-onlyList News Sources
List the news sources available for top headlines, optionally filtered by category, language or country. Returns sources with id, name, description, url, category, language and country. Use this to find source IDs for newsapi_top_headlines_list or newsapi_articles_search.
Inputs
categorystring- Only sources that publish this category. Defaults to all categories. Example: business.one of
businessentertainmentgeneralhealthsciencesportstechnology countrystring- Only sources based in this two-letter ISO 3166-1 country. Defaults to all countries. Example: gb.one of
aearataubebgbrcachcncocuczdeegfrgbgrhkhuidieilinitjpkrltlvmamxmyngnlnonzphplptrorsrusasesgsiskthtrtwuausveza languagestring- Only sources in this two-letter ISO-639-1 language. Defaults to all languages. Example: en.one of
ardeenesfrheitnlnoptrusvudzh
newsapi_top_headlines_listList live top and breaking headlines by country, category, source or keyword.Read-onlyList Top Headlines
List live top and breaking headlines by country, category, source or keyword. Returns status, totalResults and articles with source, author, title, description, url, urlToImage, publishedAt and content. Use this for current headlines. Use newsapi_articles_search to search all articles over time. Do not combine sources with country or category.
Inputs
categorystring- Headline category. Cannot be combined with sources. Example: technology.one of
businessentertainmentgeneralhealthsciencesportstechnology countrystring- Two-letter ISO 3166-1 country code to get headlines for. Cannot be combined with sources. Example: us.
pageinteger- Page number to return, starting at 1. Defaults to 1. Example: 1.
page_sizeinteger- Number of articles per page. Defaults to 20, maximum 100. Example: 20.
qstring- Keywords or a phrase to search for in the headlines. Example: election.
sourcesstring- Comma-separated source IDs to get headlines from. Get IDs from newsapi_sources_list. Cannot be combined with country or category. Example: bbc-news.
No tools match.