Connexun empowers businesses with a robust News API, leveraging AI and machine learning to transform real-time news streams into actionable intelligence. Their API crawls and analyzes content from millions of online sources, providing valuable features like:
- Global News Coverage: Access news from various countries and languages.
- Sentiment Analysis: Gain insights into the emotional tone of news articles.
- Trend Identification: Discover emerging topics and discussions within the news landscape.
- Keyword-Based Search: Filter news based on specific keywords or topics.
Authentication:
Connexun utilizes API keys for authentication. You can obtain your free API key by creating an account on the Connexun platform.
Here's a breakdown of some key Connexun News API endpoints along with JavaScript example code snippets for each:
1. Search News by Keyword (Search)
- This endpoint retrieves news articles containing specified keywords.
- Type: GET
- JavaScript Example:
const apiKey = 'YOUR_API_KEY';
const baseUrl = 'https://api.connexun.com/news/search';
const keywords = 'artificial intelligence';
const language = 'en'; // Change language code as needed
const url = new URL(baseUrl);
url.searchParams.append('q', keywords);
url.searchParams.append('l', language);
url.searchParams.append('api_key', apiKey); // Add API key as parameter
fetch(url)
.then((response) => response.json())
.then((data) => {
console.log('News Articles:', data.data);
})
.catch((error) => console.error(error));
2. News by Country (Location)
- This endpoint retrieves news articles from a specific country.
- Type: GET
- JavaScript Example:
const apiKey = 'YOUR_API_KEY';
const baseUrl = 'https://api.connexun.com/news/location';
const countryCode = 'us'; // Change country code as needed
const url = new URL(baseUrl);
url.searchParams.append('cc', countryCode);
url.searchParams.append('api_key', apiKey); // Add API key as parameter
fetch(url)
.then((response) => response.json())
.then((data) => {
console.log('News from', countryCode, ':', data.data);
})
.catch((error) => console.error(error));
3. News by Interlinking Countries (InterCountry)
- This endpoint retrieves news articles discussing connections between two countries.
- Type: GET
- JavaScript Example:
const apiKey = 'YOUR_API_KEY';
const baseUrl = 'https://api.connexun.com/news/intercountry';
const countryCode1 = 'us'; // Change country codes as needed
const countryCode2 = 'cn';
const url = new URL(baseUrl);
url.searchParams.append('cc1', countryCode1);
url.searchParams.append('cc2', countryCode2);
url.searchParams.append('api_key', apiKey); // Add API key as parameter
fetch(url)
.then((response) => response.json())
.then((data) => {
console.log(
'News linking',
countryCode1,
'and',
countryCode2,
':',
data.data
);
})
.catch((error) => console.error(error));
4. News by Location (Geo) (Paid Plans)
- This endpoint retrieves news articles based on specific coordinates (latitude and longitude).
- Type: GET
- Note: News by Location (Geo) requires a paid subscription. Refer to Connexun documentation for details on paid plans and functionalities.
5. Sentiment Analysis (Sentiments) (Beta)
- This endpoint analyzes the emotional tone of a news article (Beta feature).
- Type: POST
- Note: Sentiment Analysis is currently in Beta. Refer to Connexun documentation for details and availability.
Explore More with Connexun
Connexun offers a free tier along with paid plans that unlock additional features and functionalities. Explore their comprehensive documentation to delve deeper into each API endpoint, advanced functionalities, and pricing options. Leverage Connexun's News API to gain valuable insights from the ever-changing world of news.