Use the APITube Postman Collection

Tasha Tatum

Tasha Tatum

·

18 mins Lees

Use the APITube Postman Collection

Use Postman to send APITube requests, check responses, and save queries for later. This guide covers importing a collection, setting your API key, and testing news filters.

What is a Postman collection?

A Postman collection is a saved set of API requests. Group related requests in one place, run them again, and share them with your team.

Key benefits of using Postman Collection:

Organize requests: Group them by purpose or API version so you can find the one you need.

Automate tests: Use pre-request and test scripts to check response status codes, validate formats, and save values for later requests.

Document requests: Add descriptions and examples so teammates can understand and run them.

Share collections: Export and import requests to work on them with your team.

Monitor an API: Run a collection on a schedule to check whether requests succeed.

What is apitube.io?

APITube.io is a news API service that gathers content from over 300,000 sources around the world in 60 languages across 177 countries. It gives developers a simple way to embed up-to-date news in their applications and websites.

Main features of apitube.io:

Real-time access to global news: Follow news sources worldwide and get the latest articles almost immediately.

Multilingual support: The API handles 60 languages, making it suitable for international projects.

Advanced search: Find news by location, date, source, category, industry, and many other parameters.

Analytics: The platform provides sentiment analysis, public opinion analysis, content categorization, and more.

Simple integration: The API is easy to integrate with any application or website in the language you prefer.

The following steps show how to use a Postman collection with the APITube API.

Setting up Postman Collection for apitube.io

Before using Postman Collection with apitube.io, you need to complete several preparatory steps. This section covers the process of setting up and creating a collection for working with the news API.

Step 1: Registration and obtaining an API key

Create an account and get an API key to authenticate your requests:

  1. Go to apitube.io
  2. Click the "Sign up" button and fill in the required information
  3. After registration, go to the API key management section
  4. Create a new key or use the automatically generated one

The API key will be used in all requests to the service, so store it securely and don't share it with third parties.

Step 2: Installing Postman

If you don't have Postman installed, download and install it. Postman is available for Windows, macOS, and Linux. Download the latest version from postman.com.

After installation, launch the application and create an account or log in to an existing one. This will let you synchronize your collections between 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 create a collection:

  1. Open Postman and click the "New" button
  2. Select "Collection"
  3. Enter a collection name, for example, "APITube News API"
  4. Add a collection description so other users can understand its purpose
  5. 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:

  1. Click the gear icon in the upper right corner of Postman
  2. Select "Manage Environments"
  3. Click "Add"
  4. Enter an environment name, for example, "APITube Environment"
  5. Add the following variables:
    • base_url: https://api.apitube.io
    • api_key: your_API_key
  6. Click "Save"
  7. Select the created environment from the dropdown list in the upper right corner of Postman

Using environment variables simplifies working with the API and enhances security, as you can share the collection without revealing your API key.

Step 5: Creating the first request

Now you're ready to create your first request to the apitube.io API:

  1. In the created collection, click the "..." (three dots) button and select "Add Request"
  2. Name the request "Get Latest News"
  3. Select the GET method from the dropdown list
  4. In the URL field, enter: https://api.apitube.io/v1/news/everything?api_key={{api_key}}&per_page=10
  5. Click "Save"

Postman replaces {{api_key}} with the value saved in your environment. The request uses https://api.apitube.io as the API address.

Step 6: Testing the request

After creating the request, you can test it immediately:

  1. Click the "Send" button
  2. 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 successful, you'll receive a JSON response with news articles. If an error occurs, check that the API key and URL are correct.

Now that the basic setup is complete, you can move on to more complex scenarios of using Postman Collection with apitube.io and expand your 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 is searching for news by keywords in the title. In Postman, this request can be implemented as follows:

  1. Create a new request in your collection and name it "Search News by Title"
  2. Select the GET method
  3. 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, use the language.code parameter:

  1. Create a new request "Get News by Language"
  2. Select the GET method
  3. 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, 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 lets you filter news by categories. For this, use the category.id parameter:

  1. Create a new request "Get News by Category"
  2. Select the GET method
  3. In the URL field, enter: https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&api_key={{api_key}}

This request will return news from the "Business" category (medtop:04000000). To get news from the "Technology" category, use medtop:13000000.

To combine filters by category and language:

https://api.apitube.io/v1/news/everything?category.id=medtop:11000000&language.code=fr&api_key={{api_key}}

This request will return news from the "Politics" category (medtop:11000000) in French.

Example 4: Using complex patterns in titles

APITube lets you match parts of a headline without writing the whole phrase. title_pattern is a substring match, not a regular expression — the API looks for the text anywhere in the title, so regex syntax such as ^, [A-Za-z]+ or .* is treated as literal characters and matches nothing:

  1. Create a new request "Get News by Title Pattern"
  2. Select the GET method
  3. In the URL field, enter: https://api.apitube.io/v1/news/everything?title_pattern=Breaking%20News&api_key={{api_key}}

This request returns news whose titles contain "Breaking News" anywhere. To anchor the match, use title_starts_with=Breaking or title_ends_with=recall instead.

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=medtop:04000000&published_at.start=2023-01-01&published_at.end=2023-01-31&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&organization.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 more effectively.

Creating complex requests with parameters

APITube provides a rich set of parameters for filtering and configuring requests to the news API. Using Postman, you can easily create and test requests with various parameter combinations.

Here's an example of creating a request to search for news on a specific topic with additional filters:

  1. Create a new request in your collection and name it "Search News by Topic"
  2. Select the GET method
  3. In the URL field, enter: https://api.apitube.io/v1/news/everything?api_key={{api_key}}
  4. Go to the "Params" tab and add the following parameters:
    • title: "artificial intelligence" (search query)
    • language.code: "en" (article language)
    • published_at.start: "2025-05-01" (search start date)
    • published_at.end: "2025-05-24" (search end date)
    • per_page: "20" (number of results)
    • sort.by: "published_at" (sort by date)

This request will return up to 20 English-language news articles about artificial intelligence published in the specified period and sorted by date.

Using pre-request and test 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, you 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, you can use {{lastWeek}} and {{today}} instead of hard-coded dates.

Test scripts

Test 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.results).to.be.an('array').that.is.not.empty;
});

// Save the ID of the first article for use in other requests
if (pm.response.json().results && pm.response.json().results.length > 0) {
    pm.environment.set('firstArticleId', pm.response.json().results[0].id);
}

Creating a chain of requests

By saving data from responses in environment variables, you can create chains of interconnected requests. For example, after getting a list of news, you can automatically request detailed information about the first article:

  1. Create a new request "Get Article Details"
  2. Set the GET method
  3. 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 lets you 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:

  1. Click the "Runner" button at the top of Postman
  2. Select your APITube collection
  3. Configure the order of requests if necessary
  4. Set the number of iterations and delay between requests
  5. Click "Start Run"

After execution, you'll receive a detailed report on the results of each request and test, which lets you quickly identify any problems in the API operation.

APITube - News API

Gerelateerde artikelen

Get started with the APITube News API
Product

Get started with the APITube News API

Create an account, get an API key, send your first APITube request, and filter the news returned by the API.

Het APITube Cookbook is beschikbaar
Product

Het APITube Cookbook is beschikbaar

Voorbeelden van nieuws API-verzoeken voor veelvoorkomende taken.

Zoek nieuws per categorie
Product

Zoek nieuws per categorie

Vind nieuwsartikelen over entertainment, zaken, technologie, sport en andere onderwerpen.

Zoek nieuws per taal
Product

Zoek nieuws per taal

Vind nieuwsartikelen in het Engels, Spaans, Frans, Duits en andere talen.

Wij gebruiken cookies

Door op "Accepteren" te klikken, gaat u akkoord met cookies op uw apparaat zodat de site werkt en voor analyse.