PHP code example of adanos / adanos-php

1. Go to this page and download the library: Download adanos/adanos-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

adanos / adanos-php example snippets




use Adanos\AdanosClient;

$client = new AdanosClient(apiKey: 'sk_live_...');

$trending = $client->reddit->trending(['limit' => 10]);
$tsla = $client->reddit->stock('TSLA');
$health = $client->health();

echo $trending[0]['ticker'] . PHP_EOL;
echo $tsla['buzz_score'] . PHP_EOL;
echo $health['status'] . PHP_EOL;

$trending = $client->reddit->trending(['limit' => 10]);
$sectors = $client->reddit->trendingSectors(['limit' => 10]);
$countries = $client->reddit->trendingCountries(['limit' => 10]);
$tsla = $client->reddit->stock('TSLA', ['from' => '2026-06-01', 'to' => '2026-06-07']);
$mentions = $client->reddit->mentions('TSLA', ['limit' => 10, '

$trending = $client->news->trending(['source' => 'reuters']);
$sectors = $client->news->trendingSectors(['source' => 'reuters']);
$countries = $client->news->trendingCountries(['source' => 'reuters']);
$nvda = $client->news->stock('NVDA');
$explanation = $client->news->explain('NVDA');
$results = $client->news->search('Nvidia', ['limit' => 10]);
$comparison = $client->news->compare(['NVDA', 'AAPL']);
$market = $client->news->marketSentiment();

$trending = $client->x->trending(['limit' => 20]);
$nvda = $client->x->stock('NVDA');
$mentions = $client->x->mentions('NVDA', ['limit' => 10]);
$comparison = $client->x->compare(['NVDA', 'AMD']);
$market = $client->x->marketSentiment();

$trending = $client->polymarket->trending(['limit' => 20, 'type' => 'stock']);
$aapl = $client->polymarket->stock('AAPL');
$results = $client->polymarket->search('Apple', ['limit' => 10]);
$comparison = $client->polymarket->compare(['AAPL', 'TSLA']);
$market = $client->polymarket->marketSentiment();

$trending = $client->crypto->trending(['limit' => 20]);
$btc = $client->crypto->token('BTC');
$mentions = $client->crypto->mentions('BTC', [
    'from' => '2026-06-01',
    'to' => '2026-06-07',
    'limit' => 10,
    '

$analysis = $client->sentiment->analyze('TSLA looks like a short squeeze setup');

echo $analysis['sentiment_label'] . PHP_EOL;
echo $analysis['sentiment_score'] . PHP_EOL;

$client->reddit->trending([
    'from' => '2026-06-01',
    'to' => '2026-06-07',
    'limit' => 10,
]);

$client = new AdanosClient(
    apiKey: 'sk_live_...',
    baseUrl: 'https://api.adanos.org',
    timeout: 60.0,
);

use Adanos\Exception\ApiException;

try {
    $client->sentiment->analyze('TSLA');
} catch (ApiException $exception) {
    echo $exception->getStatusCode();
    echo $exception->getDetail();
    $payload = $exception->getPayload();
    $headers = $exception->getHeaders();
}

use Adanos\StockSentimentClient;

$client = new StockSentimentClient(apiKey: 'sk_live_...');
bash
composer