Analyse af regional mediemæssig bias

Sammenlign, hvordan forskellige regioner dækker specifikke emner, vis om dækningen er positiv, negativ eller neutral, og filtrer efter datointerval

Inputparametre

ParameterBeskrivelseTypeStandardPåkrævet
titleSøg efter emne.stringJa
source.country.codeFlere landekoder (kommasepareret).stringJa
sort.bySorter efter sentiment score.stringJa
published_at.startStartdato-filter.stringJa
published_at.endSlutdato-filter.stringJa
facetTæl artikler efter felt.booleantrueJa
facet.fieldFelter, som artiklerne skal tælles efter.stringJa
api_keyDin API nøglestringJa
per_pageMaksimalt antal artikler, der skal hentesinteger50Nej

Workflow-eksempler

Analyse af regional mediemæssig bias:
curl -X GET "https://api.apitube.io/v1/news/everything?title=climate%20change&source.country.code=us,cn,in&sort.by=sentiment.overall.score&published_at.start=2023-01-01&published_at.end=2023-01-31&api_key=YOUR_API_KEY"
Mediebiasfordeling:
curl -X GET "https://api.apitube.io/v1/news/everything?title=climate%20change&facet=true&facet.field=source.bias,source.country.id&api_key=YOUR_API_KEY"

Relaterede eksempler

Opskrift på cURL

curl --location --globoff --request POST 'https://api.apitube.io/v1/news/everything?title=climate+change&source.country.code=us%2Ccn%2Cin&sort.by=sentiment.overall.score&published_at.start=2023-01-01&published_at.end=2023-12-31&facet=1&facet.field=source.bias%2Csource.country.id&api_key=YOUR_API_KEY&per_page=50' \
--header 'Content-Type: application/json'

Opskrift på Python

import requests

url = "https://api.apitube.io/v1/news/everything"

querystring = {
    "title": "climate change",
    "source.country.code": "us,cn,in",
    "sort.by": "sentiment.overall.score",
    "published_at.start": "2023-01-01",
    "published_at.end": "2023-12-31",
    "facet": true,
    "facet.field": "source.bias,source.country.id",
    "api_key": "YOUR_API_KEY",
    "per_page": 50
}
response = requests.request("GET", url, params=querystring)

print(response.text)

Opskrift på Javascript

import axios from "axios"

const options = {
		method: 'GET',
		url: 'https://api.apitube.io/v1/news/everything',
		params: {
    "title": "climate change",
    "source.country.code": "us,cn,in",
    "sort.by": "sentiment.overall.score",
    "published_at.start": "2023-01-01",
    "published_at.end": "2023-12-31",
    "facet": true,
    "facet.field": "source.bias,source.country.id",
    "api_key": "YOUR_API_KEY",
    "per_page": 50
}};

axios.request(options).then(function (response) {
		console.log(response.data);
}).catch(function (error) {
		console.error(error);
});

Opskrift på PHP

require 'vendor/autoload.php';

use GuzzleHttp\Client;

$client = new Client();
$response = $client->request('GET', 'https://api.apitube.io/v1/news/everything', [
	'query' => [
    'title' => 'climate change',
    'source.country.code' => 'us,cn,in',
    'sort.by' => 'sentiment.overall.score',
    'published_at.start' => '2023-01-01',
    'published_at.end' => '2023-12-31',
    'facet' => 1,
    'facet.field' => 'source.bias,source.country.id',
    'api_key' => 'YOUR_API_KEY',
    'per_page' => 50,
],
]);

echo $response->getBody();

Opskrift på Java

OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
		.url("https://api.apitube.io/v1/news/everything?title=climate+change&source.country.code=us%2Ccn%2Cin&sort.by=sentiment.overall.score&published_at.start=2023-01-01&published_at.end=2023-12-31&facet=1&facet.field=source.bias%2Csource.country.id&api_key=YOUR_API_KEY&per_page=50")
		.method("POST", body)
		.addHeader("Content-Type", "application/json")
		.build();
Response response = client.newCall(request).execute();
		
  • CNN
  • Techcrunch
  • Vox
  • Apple
  • Microsoft
  • IBM
  • Bloomberg
  • Spotify
Vi bruger cookies

Ved at klikke på "Accepter" accepterer du cookies på din enhed, så webstedet fungerer og til analyse.