Endpoints
Base URL: https://sn13.api.macrocosmos.ai
https://sn13.api.macrocosmos.ai
We provide three primary API endpoints for SN13:
POST /api/v1/on_demand_data_request
GET /api/v1/list_repo_names
POST /api/v1/set_desirabilities
Handle data queries targeting multiple miners with validation and incentives. Now supports enhanced X content with rich metadata.
Request model for data queries
Data source (x or reddit)
List of usernames to fetch data from
List of keywords to search for
Start date (ISO format)
End date (ISO format)
Maximum number of items to return
100
POST /api/v1/on_demand_data_request HTTP/1.1
Host: sn13.api.macrocosmos.ai
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 108
{
"source": "text",
"usernames": [
"text"
],
"keywords": [
"text"
],
"start_date": "text",
"end_date": "text",
"limit": 100
}
{
"status": "text",
"data": [
{}
],
"meta": {}
}
POST /api/v1/on_demand_data_request
This endpoint enables real-time social data retrieval across decentralized miners. It supports flexible querying with parameters such as keywords, usernames, timeframes, and data sources.
Supported data sources:
x
– Twitter-style contentreddit
– Subreddit-based or keyword-driven Reddit searches
You can retrieve posts from public accounts like Elon Musk , specifying a keyword (e.g. "space"
) and a timeframe. The API will return relevant posts matching your query.
To search Reddit, simply change the source
to "reddit"
and use subreddit-style keywords like "/bittensor"
.
Example usage: Example usage
List of source items with label weights
POST /api/v1/set_desirabilities HTTP/1.1
Host:
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 23
{
"desirabilities": [
{}
]
}
No content
POST /api/v1/set_desirabilities
POST /api/v1/set_desirabilities
This endpoint allows you to define scraping tasks that direct miners to focus on specific keywords or hashtags. These tasks help guide the network's attention and incentivize participation , miners receive increased rewards for successfully scraping content associated with your task.
Returns a list of repository names from the hf_validation.parquet file, excluding "no_dataset_provided".
GET /api/v1/list_repo_names HTTP/1.1
Host:
X-API-Key: YOUR_API_KEY
Accept: */*
Successful Response
{
"count": 1,
"repo_names": [
"text"
]
}
GET /api/v1/list_repo_names
GET /api/v1/list_repo_names
SN13 miners contribute to the open-source ecosystem by publishing models on Hugging Face. This endpoint returns a list of all repositories deployed by SN13 miners, enabling you to explore the tools and models built on the subnet.
Example usage: List Hugging Face Repositories
Last updated