อ้างอิงข้ามบุคคลกับองค์กรและสถานที่

Find articles mentioning specific persons in context of organizations and locations with sentiment analysis

พารามิเตอร์อินพุต

ParameterDescriptionTypeDefaultRequired
person.namePerson name to search for.stringYes
organization.nameOrganization name filter.stringYes
published_at.startStart date filter.stringYes
sort.bySort by publication date.stringYes
sort.orderDescending order.stringYes
api_keyYour API key.stringYes
per_pageMaximum number of articles to retrieve.integer20No

Workflow examples

Request for cross-reference person with organizations:
curl -X GET "https://api.apitube.io/v1/news/everything?person.name=Tim%20Cook&organization.name=Apple&published_at.start=2023-01-01&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"
Request for person sentiment analysis across sources:
curl -X GET "https://api.apitube.io/v1/news/everything?person.name=Elon%20Musk&source.domain=cnn.com,foxnews.com,bbc.com&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"
Request for public figure controversy timeline:
curl -X GET "https://api.apitube.io/v1/news/everything?person.name=Elon%20Musk&sentiment.overall.polarity=negative&published_at.start=2023-01-01&published_at.end=2023-12-31&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"
Request for multi-location business impact study:
curl -X GET "https://api.apitube.io/v1/news/everything?location.name=Silicon%20Valley,Shanghai,Bangalore&category.id=medtop:04000000&organization.name=Apple,Google,Microsoft&published_at.start=2023-01-01&api_key=YOUR_API_KEY"

ตัวอย่างที่เกี่ยวข้อง

สูตรสำหรับ cURL

curl --location --globoff --request POST 'https://api.apitube.io/v1/news/everything?person.name=Tim+Cook&organization.name=Apple&published_at.start=2023-01-01&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY&per_page=20' \
--header 'Content-Type: application/json'

สูตรสำหรับ Python

import requests

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

querystring = {
    "person.name": "Tim Cook",
    "organization.name": "Apple",
    "published_at.start": "2023-01-01",
    "sort.by": "published_at",
    "sort.order": "desc",
    "api_key": "YOUR_API_KEY",
    "per_page": 20
}
response = requests.request("GET", url, params=querystring)

print(response.text)

สูตรสำหรับ Javascript

import axios from "axios"

const options = {
		method: 'GET',
		url: 'https://api.apitube.io/v1/news/everything',
		params: {
    "person.name": "Tim Cook",
    "organization.name": "Apple",
    "published_at.start": "2023-01-01",
    "sort.by": "published_at",
    "sort.order": "desc",
    "api_key": "YOUR_API_KEY",
    "per_page": 20
}};

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

สูตรสำหรับ PHP

require 'vendor/autoload.php';

use GuzzleHttp\Client;

$client = new Client();
$response = $client->request('GET', 'https://api.apitube.io/v1/news/everything', [
	'query' => [
    'person.name' => 'Tim Cook',
    'organization.name' => 'Apple',
    'published_at.start' => '2023-01-01',
    'sort.by' => 'published_at',
    'sort.order' => 'desc',
    'api_key' => 'YOUR_API_KEY',
    'per_page' => 20,
],
]);

echo $response->getBody();

สูตรสำหรับ 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?person.name=Tim+Cook&organization.name=Apple&published_at.start=2023-01-01&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY&per_page=20")
		.method("POST", body)
		.addHeader("Content-Type", "application/json")
		.build();
Response response = client.newCall(request).execute();
		
  • CNN
  • Techcrunch
  • Vox
  • Apple
  • Microsoft
  • IBM
  • Bloomberg
  • Spotify