The Reperio REST API provides endpoints for loading, analyzing, and visualizing Apache Nutch data structures.
Base URL: http://localhost:8000
Currently, the API does not require authentication. This may change in future versions.
Check API health and current graph status.
Response:
{
"status": "healthy",
"graph_loaded": true,
"num_nodes": 12345,
"num_edges": 45678
}Load Nutch data and build graph.
Request Body:
{
"path": "hdfs://namenode:9000/nutch/crawldb",
"db_type": "crawldb",
"storage": "hdfs",
"max_records": 10000,
"hdfs_config": {
"namenode": "namenode.example.com",
"port": 9000
}
}Parameters:
path(string, required): Path to Nutch data (local or HDFS)db_type(string, required): One of:crawldb,linkdb,hostdbstorage(string, optional):localorhdfs(default:local)max_records(int, optional): Maximum records to loadhdfs_config(object, optional): HDFS configuration
Response:
{
"status": "success",
"message": "Graph loaded successfully from crawldb",
"data": {
"db_type": "crawldb",
"num_nodes": 12345,
"num_edges": 45678
}
}Get graph statistics.
Response:
{
"num_nodes": 12345,
"num_edges": 45678,
"density": 0.0123,
"is_directed": true,
"num_strongly_connected_components": 150,
"num_weakly_connected_components": 50
}Get graph data for visualization.
Query Parameters:
max_nodes(int, optional): Maximum nodes to includeformat(string, optional):jsonorsigma(default:sigma)
Response (Sigma format):
{
"nodes": [
{
"key": "http://example.com",
"attributes": {
"label": "example.com",
"x": 123.45,
"y": 678.90,
"size": 5,
"color": "#4CAF50",
"status": "fetched",
"score": 0.85
}
}
],
"edges": [
{
"key": "e0",
"source": "http://source.com",
"target": "http://target.com",
"attributes": {
"anchor": "Link text"
}
}
]
}Get graph nodes with pagination.
Query Parameters:
limit(int, optional): Maximum nodes to return (default: 100)offset(int, optional): Pagination offset (default: 0)status(string, optional): Filter by status
Response:
{
"nodes": [...],
"total": 12345,
"limit": 100,
"offset": 0
}Get graph edges with pagination.
Query Parameters:
limit(int, optional): Maximum edges to return (default: 100)offset(int, optional): Pagination offset (default: 0)
Response:
{
"edges": [...],
"total": 45678,
"limit": 100,
"offset": 0
}Search for nodes by URL.
Query Parameters:
q(string, required): Search querylimit(int, optional): Maximum results (default: 10)
Response:
{
"results": [
{
"id": "http://example.com/page",
"attributes": {...}
}
],
"total": 5,
"query": "example.com"
}Run graph analysis algorithms.
Request Body:
{
"analysis_type": "pagerank",
"params": {
"alpha": 0.85
}
}Analysis Types:
pagerank: Calculate PageRank scores- Parameters:
alpha(float, default: 0.85)
- Parameters:
centrality: Calculate degree centrality- Parameters:
type(string, default:in_degree):in_degreeorout_degree
- Parameters:
components: Find connected components- No parameters
Response (PageRank):
{
"type": "pagerank",
"top_nodes": [
["http://important-page.com", 0.1234],
["http://another-page.com", 0.0987]
]
}Filter graph by criteria.
Request Body:
{
"filter_type": "status",
"value": "fetched",
"max_value": null
}Filter Types:
status: Filter by crawl statusdomain: Filter by domain regex patternscore: Filter by score range (usevalueas min,max_valueas max)
Response:
{
"status": "success",
"filtered_nodes": 5678,
"filtered_edges": 12345
}Export graph data.
Request Body:
{
"format": "json",
"max_nodes": 10000,
"include_clustering": false
}Parameters:
format(string, required):json,sigma,gexf, orgraphmlmax_nodes(int, optional): Maximum nodes to exportinclude_clustering(bool, optional): Include community detection (default: false)
Response: Graph data in requested format.
Get host-level statistics.
Response:
{
"total_hosts": 150,
"top_hosts": [
{
"host": "example.com",
"in_degree": 1000,
"out_degree": 500,
"total_degree": 1500
}
],
"host_graph_edges": 5000
}Get current HDFS configuration.
Response:
{
"namenode": "localhost",
"port": 9000,
"hadoop_conf_dir": "/etc/hadoop/conf"
}All endpoints return standard HTTP status codes:
200 OK: Successful request400 Bad Request: Invalid parameters404 Not Found: Resource not found (e.g., no graph loaded)500 Internal Server Error: Server error
Error Response Format:
{
"detail": "Error message describing what went wrong"
}Currently, there is no rate limiting. This may be added in future versions.
WebSocket support for real-time updates is planned for a future release.