Getting Started

This guide shows how to search works and authors, fetch citations/references, and build graphs – without hand-rolling HTTP, pagination, and normalization for each provider.

Why not raw HTTP?

Installation Requirements

See Architecture for detailed PSR compatibility information.

Install

composer require scholarly/providers

Complete Example: Research Workflow

use Scholarly\Contracts\Query;
use Scholarly\Factory\AdapterFactory;

// Setup with caching
$factory = AdapterFactory::make([
    'cache' => new ArrayAdapter(), // PSR-6 cache
    'openalex' => ['mailto' => 'your-email@example.com']
]);

$openAlex = $factory->adapter('openalex');

// 1. Search for recent works on a topic
$recentWorks = $openAlex->searchWorks(Query::from([
    'q' => 'graph neural networks',
    'year' => '2023-2024',
    'openAccess' => true,
    'limit' => 50,
    'fields' => ['id', 'title', 'year', 'authors', 'counts']
]));

// 2. Build collaboration networks from results
$workIds = [];
foreach ($recentWorks as $work) {
    $workIds[] = $work['id'];
    if (count($workIds) >= 10) break; // Limit for demo
}

// 3. Generate citation graph
$exporter = $factory->graphExporter($openAlex);
$citationGraph = $exporter->buildWorkCitationGraph(
    $workIds,
    Query::from(['limit' => 100])
);

// 4. Export for analysis
$graphData = $exporter->exportToJson($citationGraph);
file_put_contents('citation_network.json', $graphData);

// 5. Run graph algorithms (requires mbsoft31/graph-algorithms)
use Mbsoft\Graph\Algorithms\Centrality\PageRank;
$influence = (new PageRank())->compute($citationGraph);
arsort($influence);
echo "Most influential work: " . array_key_first($influence) . "\n";

Common Use Cases

Academic Research Pipelines

Integration Patterns

Troubleshooting

Common Issues

Getting Help


Core Concepts: Contracts Architecture Getting Started
Features: Graph Analytics Laravel Integration Provider Adapters
Development: Extending GitHub Repository  
External Resources: OpenAlex API Semantic Scholar API Crossref API