Nowadays, APIs (Application Programming Interfaces) are important in the modern software development environment to facilitate the communication between various systems and services. The ability to successfully test, document and utilize APIs becomes critical to successful development and integration. This paper will discuss the approach to using the powerful postman collection tool to work with apitube.io - an application that lets you access news API in different parts of the world.What is Postman Collection?
A collection of organized API requests, which can be stored, organized, and reused, is called Postman Collection. Persons in Postman lead to project files which group adjacent requests and enable you to rapidly work with APIs. They can be used as a stepping stone towards a new API and one can refer to them as a living, interactive documentation.
Key benefits of the use of Postman Collection can be as follows:
Request organization -- collections enable you to cluster requests based on meaning of actions being taken, API version, or any other rule, which would make navigating and locating the required requests much easier.
Test automation also, with Pre-request and Tests scripts, you can automatically perform the API testing process with testing its statuses of responses, data formats and storing the outcomes to be used later.
API documentation Collections API documentation may be interactive, which is documentation describing the API as well as letting you make requests immediately.
Teamwork -- One can export collection, collaborate with work team and import collections which makes it easier to collaborate with the team on a project.
Service monitoring Service monitoring Dog enables you to form collections to track the well-being of API services.
What is apitube.io?
APITube.io is an effective service to get news APIs that gathers content of over 500,000 different sources around the planet in 60 languages across 177 nations. This service gives a developer a simple means of embedding up-to-date news in his or her applications and websites.
Apitube.io has the following main characteristics:
Real-time access to news on the planet--the system will give you the opportunity to follow the news sources worldwide and get the latest articles almost immediately.
Multilingual assistants - the API can handle 60 languages and this makes it good when international projects are to be undertaken.
Advanced search - possibility to find news according to several parameters: place, date, source, category, industry and a great number of other factors.
Social analytics - the platform provides sentiment analysis, public opinion analysis, and content categorization and a lot more.
Simple integration - API is simple to integrate with any application and websites in the language that you are more comfortable with.
With the ability to combine the impressive features of Postman Collection and the powerful nature of the apitube.io, the developers will get all the wide opportunities to develop applications with the up-to-date news. The sections below will discuss the process of establishing and operating Postman Collection to operate successfully with the apitube.io platform API.
Setting up Postman Collection for apitube.io
Before starting to use Postman Collection to interact with apitube.io, you need to complete several preparatory steps. In this section, we'll look in detail at the process of setting up and creating a collection for working with the news API.
Step 1: Registration and obtaining an API key
The first step to working with apitube.io is registering on the platform and obtaining a unique API key. This key is necessary to authenticate your requests to the API. The registration process is quite simple:
- Go to the official website apitube.io
- Click the "Sign up" button and fill in the required data
- After registration, go to the API key management section
- Create a new key or use the automatically generated one
The obtained API key will be used in all requests to the service, so it's important to store it in a secure place and not share it with third parties.
Step 2: Installing Postman
If you don't have Postman installed yet, you need to download and install it. Postman is available for various operating systems, including Windows, macOS, and Linux. You can download the latest version from the official website postman.com.
After installation, launch the application and create an account or log in to an existing one. This will allow you to synchronize your collections between different devices and share them with colleagues.
Step 3: Creating a new collection for apitube.io
Now that you have an API key and Postman installed, you can proceed to create a collection:
- Open Postman and click the "New" button
- Select "Collection"
- Enter a collection name, for example, "APITube News API"
- Add a collection description so that other users can understand its purpose
- Click "Create"
Step 4: Setting up environment variables
One of the key advantages of Postman is the ability to use environment variables. This is especially useful for storing API keys and base URLs that will be used in many requests.
To create an environment for apitube.io:
- Click on the gear icon in the upper right corner of Postman
- Select "Manage Environments"
- Click "Add"
- Enter an environment name, for example, "APITube Environment"
- Add the following variables:
base_url: https://api.apitube.ioapi_key: your_API_key
- Click "Save"
- Select the created environment from the dropdown list in the upper right corner of Postman
Using environment variables not only simplifies working with the API but also enhances security, as you can share the collection without revealing your API key.
Step 5: Creating the first request
Now we're ready to create our first request to the apitube.io API:
- In the created collection, click the "..." (three dots) button and select "Add Request"
- Name the request "Get Latest News"
- Select the GET method from the dropdown list
- In the URL field, enter:
https://api.apitube.io/v1/news/everything?api_key={{api_key}}&limit=10 - Click "Save"
Note that we're using the environment variables https://api.apitube.io and {{api_key}}, which will be automatically replaced with the corresponding values when the request is executed.
Step 6: Testing the request
After creating the request, you can test it immediately:
- Click the "Send" button
- In the lower part of the screen, you'll see the response from the API, which should contain a list of the latest news
If the request is executed successfully, you'll receive a JSON response with news articles. If an error occurs, check the correctness of the entered API key and URL.
Now that the basic setup is complete, we can move on to more complex scenarios of using Postman Collection with apitube.io and expand our collection with additional requests and tests.
Examples of using the apitube.io API with Postman Collection
After setting up the basic collection in Postman, let's look at specific examples of requests to the apitube.io API that you can add to your collection. These examples are based on the official API documentation and demonstrate various capabilities of the platform.
Example 1: Searching for news by keywords in the title
One of the most common scenarios for using apitube.io is searching for news by keywords in the title. In Postman, this request can be implemented as follows:
- Create a new request in your collection and name it "Search News by Title"
- Select the GET method
- In the URL field, enter:
https://api.apitube.io/v1/news/everything?title=technology&api_key={{api_key}}
This request will return all news containing the word "technology" in the title. According to the official documentation, the title parameter supports up to 5 languages simultaneously, separated by commas.
To search for news with multiple keywords in the title, you can use the following request:
https://api.apitube.io/v1/news/everything?title=AI,innovation&api_key={{api_key}}
This request will return news containing either "AI" or "innovation" in the title.
Example 2: Filtering news by language
APITube supports more than 60 languages, making it ideal for international projects. To filter news by language, you can use the language.code parameter:
- Create a new request "Get News by Language"
- Select the GET method
- In the URL field, enter:
https://api.apitube.io/v1/news/everything?language.code=en,fr&api_key={{api_key}}
This request will return news in English and French. According to the documentation, the language.code parameter supports up to 3 languages simultaneously, separated by commas.
To exclude news in a specific language, you can use the ignore.language.code parameter:
https://api.apitube.io/v1/news/everything?ignore.language.code=fr&api_key={{api_key}}
This request will return news in all languages except French.
Example 3: Filtering by categories
APITube offers the ability to filter news by categories. For this, the category.id parameter is used:
- Create a new request "Get News by Category"
- Select the GET method
- In the URL field, enter:
https://api.apitube.io/v1/news/everything?category.id=2&api_key={{api_key}}
This request will return news from the "Business" category (category ID 2). To get news from the "Technology" category, use ID 4.
To combine filters by category and language:
https://api.apitube.io/v1/news/everything?category.id=3&language.code=fr&api_key={{api_key}}
This request will return news from the "Politics" category (category ID 3) in French.
Example 4: Using complex patterns in titles
APITube allows you to use regular expressions to search for news with specific patterns in titles:
- Create a new request "Get News by Title Pattern"
- Select the GET method
- In the URL field, enter:
https://api.apitube.io/v1/news/everything?title_pattern=^Breaking%20News:%20[A-Za-z]+&api_key={{api_key}}
This request will return news whose titles start with "Breaking News:" and contain one or more alphabetic characters after that.
For more complex scenarios, you can combine various parameters:
https://api.apitube.io/v1/news/everything?title=AI&ignore.title=layoffs,job%20losses&title_starts_with=Breaking&api_key={{api_key}}
This request will return news with "AI" in the title, excluding those containing the words "layoffs" or "job losses", and the title must start with the word "Breaking".
Example 5: Market trend analysis
For market trend analysis, you can use a combination of parameters:
https://api.apitube.io/v1/news/everything?title_pattern=(bull|bear)%20market&category.id=2&published_at.start=2023-01-01&sort.by=published_at&sort.order=asc&api_key={{api_key}}
This request will return news containing the phrases "bull market" or "bear market" in the title, related to the "Business" category, published after January 1, 2023, and sorted by publication date in ascending order.
Example 6: Multilingual brand sentiment analysis
APITube provides the ability to analyze sentiment in news about specific brands:
https://api.apitube.io/v1/news/everything?language.code=en,fr,de,ja&brand.name=Netflix&sentiment.overall.polarity=positive&published_at.start=2023-01-01&sort.by=published_at&api_key={{api_key}}
This request will return positive news about Netflix in English, French, German, and Japanese, published after January 1, 2023, and sorted by publication date.
Advanced capabilities of Postman Collection for working with apitube.io
After exploring basic examples of requests to the apitube.io API, let's look at more advanced capabilities of Postman Collection that will help you work with this platform most effectively.
Creating complex requests with parameters
APITube provides a rich set of parameters for filtering and configuring requests to the news API. Using Postman, we can easily create and test requests with various parameter combinations.
Let's consider an example of creating a request to search for news on a specific topic with additional filters:
- Create a new request in your collection and name it "Search News by Topic"
- Select the GET method
- In the URL field, enter:
https://api.apitube.io/v1/news/everything?api_key={{api_key}} - Go to the "Params" tab and add the following parameters:
title: "artificial intelligence" (search query)language.code: "en" (article language)from: "2025-05-01" (search start date)to: "2025-05-24" (search end date)limit: "20" (number of results)sort.by: "date" (sort by date)
Such a request will return up to 20 English-language news about artificial intelligence published in the specified period and sorted by date.
Using Pre-request and Tests scripts
One of the most powerful tools in Postman is scripts that can be executed before and after a request. Let's look at how they can be used when working with apitube.io.
Pre-request scripts
Pre-request scripts are executed before sending a request and can be used for dynamic parameter generation. For example, we can automatically set dates for searching news for the last week:
// Get the current date
var today = new Date();
// Get the date a week ago
var lastWeek = new Date();
lastWeek.setDate(today.getDate() - 7);
// Format dates in YYYY-MM-DD format
function formatDate(date) {
var d = date.getDate();
var m = date.getMonth() + 1;
var y = date.getFullYear();
return y + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d);
}
// Set environment variables
pm.environment.set('today', formatDate(today));
pm.environment.set('lastWeek', formatDate(lastWeek));
Now in the request parameters, we can use {{lastWeek}} and {{today}} instead of hard-coded dates.
Tests scripts
Tests scripts are executed after receiving a response and can be used to check the correctness of the response and save data for subsequent requests:
// Check response status
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
// Check that the response contains news
pm.test("Response contains news articles", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.articles).to.be.an('array').that.is.not.empty;
});
// Save the ID of the first article for use in other requests
if (pm.response.json().articles && pm.response.json().articles.length > 0) {
pm.environment.set('firstArticleId', pm.response.json().articles[0].id);
}
Creating a chain of requests
By saving data from responses in environment variables, we can create chains of interconnected requests. For example, after getting a list of news, we can automatically request detailed information about the first article:
- Create a new request "Get Article Details"
- Set the GET method
- In the URL, enter:
https://api.apitube.io/v1/news/article/{{firstArticleId}}?api_key={{api_key}}
Now, if you execute the "Search News by Topic" request and then "Get Article Details", the second request will use the article ID obtained from the results of the first request.
Test automation using Collection Runner
Postman provides the Collection Runner tool, which allows you to automatically execute all requests in a collection in a specified order. This is especially useful for testing APIs and checking various usage scenarios.
To run Collection Runner:
- Click the "Runner" button at the top of Postman
- Select your APITube collection
- Configure the order of requests if necessary
- Set the number of iterations and delay between requests
- Click "Start Run"
After execution, you'll receive a detailed report on the results of each request and test, which allows you to quickly identify any problems in the API operation.


