News Api

Everything

everything

Search through millions of articles from over 30,000 large and small news sources and blogs. This includes breaking news as well as lesser articles. This endpoint suits article discovery and analysis, but can be used to retrieve articles for display, too.


/v2/everything

Usage and SDK Samples

curl -X GET -H "apieco-key: [[apiKey]]" "https://api.apieco.ir/newsapi/v2/everything?qInTitle=&excludeDomains=&domains=&sources=&from=&to=&language=&sortBy=&q=&pageSize=&page="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.EverythingApi;

import java.io.File;
import java.util.*;

public class EverythingApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: apieco-key
        ApiKeyAuth apieco-key = (ApiKeyAuth) defaultClient.getAuthentication("apieco-key");
        apieco-key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //apieco-key.setApiKeyPrefix("Token");

        EverythingApi apiInstance = new EverythingApi();
        String apiecoKey = apiecoKey_example; // String | 
        String qInTitle = qInTitle_example; // String | Keywords or phrases to search for in the article title only.
        String excludeDomains = excludeDomains_example; // String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to remove from the results.
        String domains = domains_example; // String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to restrict the search to.
        String sources = sources_example; // String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
        String from = from_example; // String | A date and optional time for the oldest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the oldest according to your plan.
        String to = to_example; // String | A date and optional time for the newest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the newest according to your plan
        String language = language_example; // String | The 2-letter ISO-639-1 code of the language you want to get headlines
        String sortBy = sortBy_example; // String | The order to sort the articles in. Possible options: relevancy, popularity, publishedAt. relevancy = articles more closely related to q come first. popularity = articles from popular sources and publishers come first. publishedAt = newest articles come first. Default: publishedAt              
        String q = q_example; // String | Keywords or phrases to search for in the article title and body.
Advanced search is supported here:
Surround phrases with quotes (") for exact match. Prepend words or phrases that must appear with a + symbol. Eg: +bitcoin Prepend words that must not appear with a - symbol. Eg: -bitcoin Alternatively you can use the AND / OR / NOT keywords, and optionally group           these with parenthesis. Eg: crypto AND (ethereum OR litecoin) NOT bitcoin.
        Integer pageSize = 56; // Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum.
        Integer page = 56; // Integer | Use this to page through the results if the total results found is greater than the page size.
        try {
            array[inline_response_200] result = apiInstance.everything(apiecoKey, qInTitle, excludeDomains, domains, sources, from, to, language, sortBy, q, pageSize, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EverythingApi#everything");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.EverythingApi;

public class EverythingApiExample {

    public static void main(String[] args) {
        EverythingApi apiInstance = new EverythingApi();
        String apiecoKey = apiecoKey_example; // String | 
        String qInTitle = qInTitle_example; // String | Keywords or phrases to search for in the article title only.
        String excludeDomains = excludeDomains_example; // String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to remove from the results.
        String domains = domains_example; // String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to restrict the search to.
        String sources = sources_example; // String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
        String from = from_example; // String | A date and optional time for the oldest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the oldest according to your plan.
        String to = to_example; // String | A date and optional time for the newest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the newest according to your plan
        String language = language_example; // String | The 2-letter ISO-639-1 code of the language you want to get headlines
        String sortBy = sortBy_example; // String | The order to sort the articles in. Possible options: relevancy, popularity, publishedAt. relevancy = articles more closely related to q come first. popularity = articles from popular sources and publishers come first. publishedAt = newest articles come first. Default: publishedAt              
        String q = q_example; // String | Keywords or phrases to search for in the article title and body.
Advanced search is supported here:
Surround phrases with quotes (") for exact match. Prepend words or phrases that must appear with a + symbol. Eg: +bitcoin Prepend words that must not appear with a - symbol. Eg: -bitcoin Alternatively you can use the AND / OR / NOT keywords, and optionally group           these with parenthesis. Eg: crypto AND (ethereum OR litecoin) NOT bitcoin.
        Integer pageSize = 56; // Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum.
        Integer page = 56; // Integer | Use this to page through the results if the total results found is greater than the page size.
        try {
            array[inline_response_200] result = apiInstance.everything(apiecoKey, qInTitle, excludeDomains, domains, sources, from, to, language, sortBy, q, pageSize, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EverythingApi#everything");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: apieco-key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"apieco-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"apieco-key"];

String *apiecoKey = apiecoKey_example; // 
String *qInTitle = qInTitle_example; // Keywords or phrases to search for in the article title only. (optional)
String *excludeDomains = excludeDomains_example; // A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to remove from the results. (optional)
String *domains = domains_example; // A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to restrict the search to. (optional)
String *sources = sources_example; // A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically (optional)
String *from = from_example; // A date and optional time for the oldest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the oldest according to your plan. (optional)
String *to = to_example; // A date and optional time for the newest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the newest according to your plan (optional)
String *language = language_example; // The 2-letter ISO-639-1 code of the language you want to get headlines (optional)
String *sortBy = sortBy_example; // The order to sort the articles in. Possible options: relevancy, popularity, publishedAt. relevancy = articles more closely related to q come first. popularity = articles from popular sources and publishers come first. publishedAt = newest articles come first. Default: publishedAt               (optional)
String *q = q_example; // Keywords or phrases to search for in the article title and body.
Advanced search is supported here:
Surround phrases with quotes (") for exact match. Prepend words or phrases that must appear with a + symbol. Eg: +bitcoin Prepend words that must not appear with a - symbol. Eg: -bitcoin Alternatively you can use the AND / OR / NOT keywords, and optionally group           these with parenthesis. Eg: crypto AND (ethereum OR litecoin) NOT bitcoin. (optional)
Integer *pageSize = 56; // The number of results to return per page (request). 20 is the default, 100 is the maximum. (optional)
Integer *page = 56; // Use this to page through the results if the total results found is greater than the page size. (optional)

EverythingApi *apiInstance = [[EverythingApi alloc] init];

[apiInstance everythingWith:apiecoKey
    qInTitle:qInTitle
    excludeDomains:excludeDomains
    domains:domains
    sources:sources
    from:from
    to:to
    language:language
    sortBy:sortBy
    q:q
    pageSize:pageSize
    page:page
              completionHandler: ^(array[inline_response_200] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var NewsApi = require('_news_api');
var defaultClient = NewsApi.ApiClient.instance;

// Configure API key authorization: apieco-key
var apieco-key = defaultClient.authentications['apieco-key'];
apieco-key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.apiKeyPrefix['apieco-key'] = "Token"

var api = new NewsApi.EverythingApi()

var apiecoKey = apiecoKey_example; // {String} 

var opts = { 
  'qInTitle': qInTitle_example, // {String} Keywords or phrases to search for in the article title only.
  'excludeDomains': excludeDomains_example, // {String} A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to remove from the results.
  'domains': domains_example, // {String} A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to restrict the search to.
  'sources': sources_example, // {String} A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
  'from': from_example, // {String} A date and optional time for the oldest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the oldest according to your plan.
  'to': to_example, // {String} A date and optional time for the newest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the newest according to your plan
  'language': language_example, // {String} The 2-letter ISO-639-1 code of the language you want to get headlines
  'sortBy': sortBy_example, // {String} The order to sort the articles in. Possible options: relevancy, popularity, publishedAt. relevancy = articles more closely related to q come first. popularity = articles from popular sources and publishers come first. publishedAt = newest articles come first. Default: publishedAt              
  'q': q_example, // {String} Keywords or phrases to search for in the article title and body.
Advanced search is supported here:
Surround phrases with quotes (") for exact match. Prepend words or phrases that must appear with a + symbol. Eg: +bitcoin Prepend words that must not appear with a - symbol. Eg: -bitcoin Alternatively you can use the AND / OR / NOT keywords, and optionally group           these with parenthesis. Eg: crypto AND (ethereum OR litecoin) NOT bitcoin.
  'pageSize': 56, // {Integer} The number of results to return per page (request). 20 is the default, 100 is the maximum.
  'page': 56 // {Integer} Use this to page through the results if the total results found is greater than the page size.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.everything(apiecoKey, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class everythingExample
    {
        public void main()
        {
            
            // Configure API key authorization: apieco-key
            Configuration.Default.ApiKey.Add("apieco-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("apieco-key", "Bearer");

            var apiInstance = new EverythingApi();
            var apiecoKey = apiecoKey_example;  // String | 
            var qInTitle = qInTitle_example;  // String | Keywords or phrases to search for in the article title only. (optional) 
            var excludeDomains = excludeDomains_example;  // String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to remove from the results. (optional) 
            var domains = domains_example;  // String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to restrict the search to. (optional) 
            var sources = sources_example;  // String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically (optional) 
            var from = from_example;  // String | A date and optional time for the oldest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the oldest according to your plan. (optional) 
            var to = to_example;  // String | A date and optional time for the newest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the newest according to your plan (optional) 
            var language = language_example;  // String | The 2-letter ISO-639-1 code of the language you want to get headlines (optional) 
            var sortBy = sortBy_example;  // String | The order to sort the articles in. Possible options: relevancy, popularity, publishedAt. relevancy = articles more closely related to q come first. popularity = articles from popular sources and publishers come first. publishedAt = newest articles come first. Default: publishedAt               (optional) 
            var q = q_example;  // String | Keywords or phrases to search for in the article title and body.
Advanced search is supported here:
Surround phrases with quotes (") for exact match. Prepend words or phrases that must appear with a + symbol. Eg: +bitcoin Prepend words that must not appear with a - symbol. Eg: -bitcoin Alternatively you can use the AND / OR / NOT keywords, and optionally group           these with parenthesis. Eg: crypto AND (ethereum OR litecoin) NOT bitcoin. (optional) 
            var pageSize = 56;  // Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum. (optional) 
            var page = 56;  // Integer | Use this to page through the results if the total results found is greater than the page size. (optional) 

            try
            {
                array[inline_response_200] result = apiInstance.everything(apiecoKey, qInTitle, excludeDomains, domains, sources, from, to, language, sortBy, q, pageSize, page);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EverythingApi.everything: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: apieco-key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('apieco-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apieco-key', 'Bearer');

$api_instance = new Swagger\Client\Api\EverythingApi();
$apiecoKey = apiecoKey_example; // String | 
$qInTitle = qInTitle_example; // String | Keywords or phrases to search for in the article title only.
$excludeDomains = excludeDomains_example; // String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to remove from the results.
$domains = domains_example; // String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to restrict the search to.
$sources = sources_example; // String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
$from = from_example; // String | A date and optional time for the oldest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the oldest according to your plan.
$to = to_example; // String | A date and optional time for the newest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the newest according to your plan
$language = language_example; // String | The 2-letter ISO-639-1 code of the language you want to get headlines
$sortBy = sortBy_example; // String | The order to sort the articles in. Possible options: relevancy, popularity, publishedAt. relevancy = articles more closely related to q come first. popularity = articles from popular sources and publishers come first. publishedAt = newest articles come first. Default: publishedAt              
$q = q_example; // String | Keywords or phrases to search for in the article title and body.
Advanced search is supported here:
Surround phrases with quotes (") for exact match. Prepend words or phrases that must appear with a + symbol. Eg: +bitcoin Prepend words that must not appear with a - symbol. Eg: -bitcoin Alternatively you can use the AND / OR / NOT keywords, and optionally group           these with parenthesis. Eg: crypto AND (ethereum OR litecoin) NOT bitcoin.
$pageSize = 56; // Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum.
$page = 56; // Integer | Use this to page through the results if the total results found is greater than the page size.

try {
    $result = $api_instance->everything($apiecoKey, $qInTitle, $excludeDomains, $domains, $sources, $from, $to, $language, $sortBy, $q, $pageSize, $page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EverythingApi->everything: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::EverythingApi;

# Configure API key authorization: apieco-key
$WWW::SwaggerClient::Configuration::api_key->{'apieco-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'apieco-key'} = "Bearer";

my $api_instance = WWW::SwaggerClient::EverythingApi->new();
my $apiecoKey = apiecoKey_example; # String | 
my $qInTitle = qInTitle_example; # String | Keywords or phrases to search for in the article title only.
my $excludeDomains = excludeDomains_example; # String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to remove from the results.
my $domains = domains_example; # String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to restrict the search to.
my $sources = sources_example; # String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
my $from = from_example; # String | A date and optional time for the oldest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the oldest according to your plan.
my $to = to_example; # String | A date and optional time for the newest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the newest according to your plan
my $language = language_example; # String | The 2-letter ISO-639-1 code of the language you want to get headlines
my $sortBy = sortBy_example; # String | The order to sort the articles in. Possible options: relevancy, popularity, publishedAt. relevancy = articles more closely related to q come first. popularity = articles from popular sources and publishers come first. publishedAt = newest articles come first. Default: publishedAt              
my $q = q_example; # String | Keywords or phrases to search for in the article title and body.
Advanced search is supported here:
Surround phrases with quotes (") for exact match. Prepend words or phrases that must appear with a + symbol. Eg: +bitcoin Prepend words that must not appear with a - symbol. Eg: -bitcoin Alternatively you can use the AND / OR / NOT keywords, and optionally group           these with parenthesis. Eg: crypto AND (ethereum OR litecoin) NOT bitcoin.
my $pageSize = 56; # Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum.
my $page = 56; # Integer | Use this to page through the results if the total results found is greater than the page size.

eval { 
    my $result = $api_instance->everything(apiecoKey => $apiecoKey, qInTitle => $qInTitle, excludeDomains => $excludeDomains, domains => $domains, sources => $sources, from => $from, to => $to, language => $language, sortBy => $sortBy, q => $q, pageSize => $pageSize, page => $page);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling EverythingApi->everything: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apieco-key
swagger_client.configuration.api_key['apieco-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['apieco-key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.EverythingApi()
apiecoKey = apiecoKey_example # String | 
qInTitle = qInTitle_example # String | Keywords or phrases to search for in the article title only. (optional)
excludeDomains = excludeDomains_example # String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to remove from the results. (optional)
domains = domains_example # String | A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to restrict the search to. (optional)
sources = sources_example # String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically (optional)
from = from_example # String | A date and optional time for the oldest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the oldest according to your plan. (optional)
to = to_example # String | A date and optional time for the newest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the newest according to your plan (optional)
language = language_example # String | The 2-letter ISO-639-1 code of the language you want to get headlines (optional)
sortBy = sortBy_example # String | The order to sort the articles in. Possible options: relevancy, popularity, publishedAt. relevancy = articles more closely related to q come first. popularity = articles from popular sources and publishers come first. publishedAt = newest articles come first. Default: publishedAt               (optional)
q = q_example # String | Keywords or phrases to search for in the article title and body.
Advanced search is supported here:
Surround phrases with quotes (") for exact match. Prepend words or phrases that must appear with a + symbol. Eg: +bitcoin Prepend words that must not appear with a - symbol. Eg: -bitcoin Alternatively you can use the AND / OR / NOT keywords, and optionally group           these with parenthesis. Eg: crypto AND (ethereum OR litecoin) NOT bitcoin. (optional)
pageSize = 56 # Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum. (optional)
page = 56 # Integer | Use this to page through the results if the total results found is greater than the page size. (optional)

try: 
    api_response = api_instance.everything(apiecoKey, qInTitle=qInTitle, excludeDomains=excludeDomains, domains=domains, sources=sources, from=from, to=to, language=language, sortBy=sortBy, q=q, pageSize=pageSize, page=page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling EverythingApi->everything: %s\n" % e)

Parameters

Header parameters
Name Description
apieco-key*
String
Required
Query parameters
Name Description
qInTitle
String
Keywords or phrases to search for in the article title only.
excludeDomains
String
A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to remove from the results.
domains
String
A comma-seperated string of domains (eg bbc.co.uk, techcrunch.com, engadget.com) to restrict the search to.
sources
String
A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
from
String
A date and optional time for the oldest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the oldest according to your plan.
to
String
A date and optional time for the newest article allowed. This should be in ISO 8601 format (e.g. 2020-04-10 or 2020-04-10T07:20:02) Default: the newest according to your plan
language
String
The 2-letter ISO-639-1 code of the language you want to get headlines
sortBy
String
The order to sort the articles in. Possible options: relevancy, popularity, publishedAt. relevancy = articles more closely related to q come first. popularity = articles from popular sources and publishers come first. publishedAt = newest articles come first. Default: publishedAt
q
String
Keywords or phrases to search for in the article title and body. Advanced search is supported here: Surround phrases with quotes (") for exact match. Prepend words or phrases that must appear with a + symbol. Eg: +bitcoin Prepend words that must not appear with a - symbol. Eg: -bitcoin Alternatively you can use the AND / OR / NOT keywords, and optionally group these with parenthesis. Eg: crypto AND (ethereum OR litecoin) NOT bitcoin.
pageSize
Integer
The number of results to return per page (request). 20 is the default, 100 is the maximum.
page
Integer
Use this to page through the results if the total results found is greater than the page size.

Responses

Status: 200 - Succesfull

Status: 401 - wrong code

Status: 405 - Invalid input


Sources

sources

This endpoint returns the subset of news publishers that top headlines (/v2/top-headlines) are available from. It's mainly a convenience endpoint that you can use to keep track of the publishers available on the API, and you can pipe it straight through to your users.


/v2/sources

Usage and SDK Samples

curl -X GET -H "apieco-key: [[apiKey]]" "https://api.apieco.ir/newsapi/v2/sources?country=&category=&language="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SourcesApi;

import java.io.File;
import java.util.*;

public class SourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: apieco-key
        ApiKeyAuth apieco-key = (ApiKeyAuth) defaultClient.getAuthentication("apieco-key");
        apieco-key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //apieco-key.setApiKeyPrefix("Token");

        SourcesApi apiInstance = new SourcesApi();
        String apiecoKey = apiecoKey_example; // String | 
        String country = country_example; // String | The 2-letter ISO 3166-1 code of the country you want to get headlines for
        String category = category_example; // String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology
        String language = language_example; // String | Find sources that display news in a specific language
        try {
            inline_response_200_1 result = apiInstance.sources(apiecoKey, country, category, language);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SourcesApi#sources");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SourcesApi;

public class SourcesApiExample {

    public static void main(String[] args) {
        SourcesApi apiInstance = new SourcesApi();
        String apiecoKey = apiecoKey_example; // String | 
        String country = country_example; // String | The 2-letter ISO 3166-1 code of the country you want to get headlines for
        String category = category_example; // String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology
        String language = language_example; // String | Find sources that display news in a specific language
        try {
            inline_response_200_1 result = apiInstance.sources(apiecoKey, country, category, language);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SourcesApi#sources");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: apieco-key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"apieco-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"apieco-key"];

String *apiecoKey = apiecoKey_example; // 
String *country = country_example; // The 2-letter ISO 3166-1 code of the country you want to get headlines for (optional)
String *category = category_example; // The category you want to get headlines for. Possible options: business entertainment general health science sports technology (optional)
String *language = language_example; // Find sources that display news in a specific language (optional)

SourcesApi *apiInstance = [[SourcesApi alloc] init];

[apiInstance sourcesWith:apiecoKey
    country:country
    category:category
    language:language
              completionHandler: ^(inline_response_200_1 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var NewsApi = require('_news_api');
var defaultClient = NewsApi.ApiClient.instance;

// Configure API key authorization: apieco-key
var apieco-key = defaultClient.authentications['apieco-key'];
apieco-key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.apiKeyPrefix['apieco-key'] = "Token"

var api = new NewsApi.SourcesApi()

var apiecoKey = apiecoKey_example; // {String} 

var opts = { 
  'country': country_example, // {String} The 2-letter ISO 3166-1 code of the country you want to get headlines for
  'category': category_example, // {String} The category you want to get headlines for. Possible options: business entertainment general health science sports technology
  'language': language_example // {String} Find sources that display news in a specific language
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.sources(apiecoKey, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class sourcesExample
    {
        public void main()
        {
            
            // Configure API key authorization: apieco-key
            Configuration.Default.ApiKey.Add("apieco-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("apieco-key", "Bearer");

            var apiInstance = new SourcesApi();
            var apiecoKey = apiecoKey_example;  // String | 
            var country = country_example;  // String | The 2-letter ISO 3166-1 code of the country you want to get headlines for (optional) 
            var category = category_example;  // String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology (optional) 
            var language = language_example;  // String | Find sources that display news in a specific language (optional) 

            try
            {
                inline_response_200_1 result = apiInstance.sources(apiecoKey, country, category, language);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SourcesApi.sources: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: apieco-key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('apieco-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apieco-key', 'Bearer');

$api_instance = new Swagger\Client\Api\SourcesApi();
$apiecoKey = apiecoKey_example; // String | 
$country = country_example; // String | The 2-letter ISO 3166-1 code of the country you want to get headlines for
$category = category_example; // String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology
$language = language_example; // String | Find sources that display news in a specific language

try {
    $result = $api_instance->sources($apiecoKey, $country, $category, $language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SourcesApi->sources: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SourcesApi;

# Configure API key authorization: apieco-key
$WWW::SwaggerClient::Configuration::api_key->{'apieco-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'apieco-key'} = "Bearer";

my $api_instance = WWW::SwaggerClient::SourcesApi->new();
my $apiecoKey = apiecoKey_example; # String | 
my $country = country_example; # String | The 2-letter ISO 3166-1 code of the country you want to get headlines for
my $category = category_example; # String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology
my $language = language_example; # String | Find sources that display news in a specific language

eval { 
    my $result = $api_instance->sources(apiecoKey => $apiecoKey, country => $country, category => $category, language => $language);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SourcesApi->sources: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apieco-key
swagger_client.configuration.api_key['apieco-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['apieco-key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.SourcesApi()
apiecoKey = apiecoKey_example # String | 
country = country_example # String | The 2-letter ISO 3166-1 code of the country you want to get headlines for (optional)
category = category_example # String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology (optional)
language = language_example # String | Find sources that display news in a specific language (optional)

try: 
    api_response = api_instance.sources(apiecoKey, country=country, category=category, language=language)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SourcesApi->sources: %s\n" % e)

Parameters

Header parameters
Name Description
apieco-key*
String
Required
Query parameters
Name Description
country
String
The 2-letter ISO 3166-1 code of the country you want to get headlines for
category
String
The category you want to get headlines for. Possible options: business entertainment general health science sports technology
language
String
Find sources that display news in a specific language

Responses

Status: 200 - Succesfull

Status: 401 - wrong code

Status: 405 - Invalid input


TopHeadLines

headLines

This endpoint provides live top and breaking headlines for a country, specific category in a country, single source, or multiple sources. You can also search with keywords. Articles are sorted by the earliest date published first. This endpoint is great for retrieving headlines for display on news tickers or similar.


/v2/top-headlines

Usage and SDK Samples

curl -X GET -H "apieco-key: [[apiKey]]" "https://api.apieco.ir/newsapi/v2/top-headlines?country=&category=&sources=&q=&pageSize=&page="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TopHeadLinesApi;

import java.io.File;
import java.util.*;

public class TopHeadLinesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: apieco-key
        ApiKeyAuth apieco-key = (ApiKeyAuth) defaultClient.getAuthentication("apieco-key");
        apieco-key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //apieco-key.setApiKeyPrefix("Token");

        TopHeadLinesApi apiInstance = new TopHeadLinesApi();
        String apiecoKey = apiecoKey_example; // String | 
        String country = country_example; // String | The 2-letter ISO 3166-1 code of the country you want to get headlines for
        String category = category_example; // String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology
        String sources = sources_example; // String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
        String q = q_example; // String | Keywords or a phrase to search for.
        Integer pageSize = 56; // Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum.
        Integer page = 56; // Integer | Use this to page through the results if the total results found is greater than the page size.
        try {
            array[inline_response_200] result = apiInstance.headLines(apiecoKey, country, category, sources, q, pageSize, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TopHeadLinesApi#headLines");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TopHeadLinesApi;

public class TopHeadLinesApiExample {

    public static void main(String[] args) {
        TopHeadLinesApi apiInstance = new TopHeadLinesApi();
        String apiecoKey = apiecoKey_example; // String | 
        String country = country_example; // String | The 2-letter ISO 3166-1 code of the country you want to get headlines for
        String category = category_example; // String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology
        String sources = sources_example; // String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
        String q = q_example; // String | Keywords or a phrase to search for.
        Integer pageSize = 56; // Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum.
        Integer page = 56; // Integer | Use this to page through the results if the total results found is greater than the page size.
        try {
            array[inline_response_200] result = apiInstance.headLines(apiecoKey, country, category, sources, q, pageSize, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TopHeadLinesApi#headLines");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: apieco-key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"apieco-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"apieco-key"];

String *apiecoKey = apiecoKey_example; // 
String *country = country_example; // The 2-letter ISO 3166-1 code of the country you want to get headlines for (optional)
String *category = category_example; // The category you want to get headlines for. Possible options: business entertainment general health science sports technology (optional)
String *sources = sources_example; // A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically (optional)
String *q = q_example; // Keywords or a phrase to search for. (optional)
Integer *pageSize = 56; // The number of results to return per page (request). 20 is the default, 100 is the maximum. (optional)
Integer *page = 56; // Use this to page through the results if the total results found is greater than the page size. (optional)

TopHeadLinesApi *apiInstance = [[TopHeadLinesApi alloc] init];

[apiInstance headLinesWith:apiecoKey
    country:country
    category:category
    sources:sources
    q:q
    pageSize:pageSize
    page:page
              completionHandler: ^(array[inline_response_200] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var NewsApi = require('_news_api');
var defaultClient = NewsApi.ApiClient.instance;

// Configure API key authorization: apieco-key
var apieco-key = defaultClient.authentications['apieco-key'];
apieco-key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.apiKeyPrefix['apieco-key'] = "Token"

var api = new NewsApi.TopHeadLinesApi()

var apiecoKey = apiecoKey_example; // {String} 

var opts = { 
  'country': country_example, // {String} The 2-letter ISO 3166-1 code of the country you want to get headlines for
  'category': category_example, // {String} The category you want to get headlines for. Possible options: business entertainment general health science sports technology
  'sources': sources_example, // {String} A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
  'q': q_example, // {String} Keywords or a phrase to search for.
  'pageSize': 56, // {Integer} The number of results to return per page (request). 20 is the default, 100 is the maximum.
  'page': 56 // {Integer} Use this to page through the results if the total results found is greater than the page size.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.headLines(apiecoKey, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class headLinesExample
    {
        public void main()
        {
            
            // Configure API key authorization: apieco-key
            Configuration.Default.ApiKey.Add("apieco-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("apieco-key", "Bearer");

            var apiInstance = new TopHeadLinesApi();
            var apiecoKey = apiecoKey_example;  // String | 
            var country = country_example;  // String | The 2-letter ISO 3166-1 code of the country you want to get headlines for (optional) 
            var category = category_example;  // String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology (optional) 
            var sources = sources_example;  // String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically (optional) 
            var q = q_example;  // String | Keywords or a phrase to search for. (optional) 
            var pageSize = 56;  // Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum. (optional) 
            var page = 56;  // Integer | Use this to page through the results if the total results found is greater than the page size. (optional) 

            try
            {
                array[inline_response_200] result = apiInstance.headLines(apiecoKey, country, category, sources, q, pageSize, page);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TopHeadLinesApi.headLines: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: apieco-key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('apieco-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apieco-key', 'Bearer');

$api_instance = new Swagger\Client\Api\TopHeadLinesApi();
$apiecoKey = apiecoKey_example; // String | 
$country = country_example; // String | The 2-letter ISO 3166-1 code of the country you want to get headlines for
$category = category_example; // String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology
$sources = sources_example; // String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
$q = q_example; // String | Keywords or a phrase to search for.
$pageSize = 56; // Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum.
$page = 56; // Integer | Use this to page through the results if the total results found is greater than the page size.

try {
    $result = $api_instance->headLines($apiecoKey, $country, $category, $sources, $q, $pageSize, $page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TopHeadLinesApi->headLines: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TopHeadLinesApi;

# Configure API key authorization: apieco-key
$WWW::SwaggerClient::Configuration::api_key->{'apieco-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'apieco-key'} = "Bearer";

my $api_instance = WWW::SwaggerClient::TopHeadLinesApi->new();
my $apiecoKey = apiecoKey_example; # String | 
my $country = country_example; # String | The 2-letter ISO 3166-1 code of the country you want to get headlines for
my $category = category_example; # String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology
my $sources = sources_example; # String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
my $q = q_example; # String | Keywords or a phrase to search for.
my $pageSize = 56; # Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum.
my $page = 56; # Integer | Use this to page through the results if the total results found is greater than the page size.

eval { 
    my $result = $api_instance->headLines(apiecoKey => $apiecoKey, country => $country, category => $category, sources => $sources, q => $q, pageSize => $pageSize, page => $page);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TopHeadLinesApi->headLines: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apieco-key
swagger_client.configuration.api_key['apieco-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['apieco-key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.TopHeadLinesApi()
apiecoKey = apiecoKey_example # String | 
country = country_example # String | The 2-letter ISO 3166-1 code of the country you want to get headlines for (optional)
category = category_example # String | The category you want to get headlines for. Possible options: business entertainment general health science sports technology (optional)
sources = sources_example # String | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically (optional)
q = q_example # String | Keywords or a phrase to search for. (optional)
pageSize = 56 # Integer | The number of results to return per page (request). 20 is the default, 100 is the maximum. (optional)
page = 56 # Integer | Use this to page through the results if the total results found is greater than the page size. (optional)

try: 
    api_response = api_instance.head_lines(apiecoKey, country=country, category=category, sources=sources, q=q, pageSize=pageSize, page=page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TopHeadLinesApi->headLines: %s\n" % e)

Parameters

Header parameters
Name Description
apieco-key*
String
Required
Query parameters
Name Description
country
String
The 2-letter ISO 3166-1 code of the country you want to get headlines for
category
String
The category you want to get headlines for. Possible options: business entertainment general health science sports technology
sources
String
A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /sources endpoint to locate these programmatically
q
String
Keywords or a phrase to search for.
pageSize
Integer
The number of results to return per page (request). 20 is the default, 100 is the maximum.
page
Integer
Use this to page through the results if the total results found is greater than the page size.

Responses

Status: 200 - Succesfull

Status: 401 - wrong code

Status: 405 - Invalid input