Endpoints

Base URL: 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


Streaming API

post

Handle data queries targeting multiple miners with validation and incentives. Now supports enhanced X content with rich metadata.

Authorizations
Body

Request model for data queries

sourcestringRequired

Data source (x or reddit)

usernamesstring[] · max: 10Optional

List of usernames to fetch data from

keywordsstring[] · max: 5Optional

List of keywords to search for

start_dateany ofOptional

Start date (ISO format)

stringOptional
or
nullOptional
end_dateany ofOptional

End date (ISO format)

stringOptional
or
nullOptional
limitinteger · min: 1 · max: 1000Optional

Maximum number of items to return

Default: 100
Responses
200
Successful Response
application/json
post
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 content

  • reddit – 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

Set Desirabilities

post
Authorizations
Body
desirabilitiesobject[]Required

List of source items with label weights

Responses
200
Successful Response
application/json
Responseany
post
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

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.

List Hf Repo Names

get

Returns a list of repository names from the hf_validation.parquet file, excluding "no_dataset_provided".

Authorizations
Responses
200
Successful Response
application/json
get
GET /api/v1/list_repo_names HTTP/1.1
Host: 
X-API-Key: YOUR_API_KEY
Accept: */*
200

Successful Response

{
  "count": 1,
  "repo_names": [
    "text"
  ]
}

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