Nina Protocol API (0.0.1)

Download OpenAPI specification:Download

Introduction

Repo: https://github.com/nina-protocol/nina-indexer.

Public API endpoint: https://api.ninaprotocol.com/v1

API Explorer on Nina Dev

JS-SDK on NPM

Accounts

Accounts describe instances of Users on Nina and are created when a wallet interacts with the Nina program in any way.

An Account's publicKey is the the address of the Solana wallet that owns the Account.

Relations:

  • published: Releases published by an Account
  • collected: Releases currently held by an Account
  • exchanges: Exchanges exchanges opened, cancelled, or completed by an Account
  • hubs: Hubs that an account is a collaborator on
  • posts: Posts that an account has published
  • revenueShares: Releases that an Account has a revenue share on

Get All Accounts

Responses

Response samples

Content type
application/json
{
  • "accounts": [
    ],
  • "total": 100
}

Get Account by publicKey

path Parameters
publicKey
required
string
Example: 52xYtQzDaxeTGcz3WD37mAJgqVFAzR72EnGYaSHab5DQ

The publicKey of the Account to be fetched

Responses

Response samples

Content type
application/json
{
  • "collected": [],
  • "published": [],
  • "hubs": [],
  • "posts": [
    ],
  • "exchanges": [
    ],
  • "revenueShares": []
}

Get Collected by publicKey

path Parameters
publicKey
required
string

The publicKey of the Account to be fetched

Responses

Response samples

Content type
application/json
{}

Get Exchanges by publicKey

An Array of all Exhanges this Account has created or completed.

path Parameters
publicKey
required
string

The publicKey of the Account to be fetched

Responses

Response samples

Content type
application/json
{
  • "exchanges": [
    ]
}

Get Hubs by publicKey

An Array of all Hubs this Account is a collaborator on.

path Parameters
publicKey
required
string

The publicKey of the Account to be fetched

Responses

Response samples

Content type
application/json
{
  • "hubs": []
}

Get Posts by publicKey

An Array of all Posts this Account has published.

path Parameters
publicKey
required
string

The publicKey of the Account to be fetched

Responses

Response samples

Content type
application/json
{
  • "posts": [
    ]
}

Get Published by publicKey

An Array of all Releases this Account has published.

path Parameters
publicKey
required
string

The publicKey of the Account to be fetched

Responses

Response samples

Content type
application/json
{}

Exchanges

Exchanges are instances of Secondary Market activity through the Nina program.

An Exchange may describe an open, cancelled, or completed exchange.

If exchange.cancelled is true, the exchange is cancelled and the on-chain Exchange account has been closed.

If exchange.completedBy is not null the exchange has been completed.

Cancelled and Completed Exchanges have had their on-chain accounts closed - you can no longer them on-chain.

Get All Exchanges

Responses

Response samples

Content type
application/json
{
  • "exchanges": [
    ],
  • "total": 500
}

Get Exchange by publicKey

path Parameters
publicKey
required
string

The publicKey of the Exchange to be fetched

Responses

Response samples

Content type
application/json
{
  • "publicKey": "2w1LbxjmPRHjhFpfMuvhLVhqZrNpTfdLo9nYptvZD2YK",
  • "isSale": true,
  • "expectedAmount": "249.00",
  • "initializerAmount": "1.00",
  • "cancelled": false,
  • "createdAt": "2020-01-01T00:00:00Z",
  • "updatedAt": "2020-01-01T00:00:00Z",
  • "completedBy": "EmQVguncDATg1m9mgZcfJ5aDbvg5u3QXPfvfesyYXAW5",
  • "release": "E9KmAF9cXLE3kehLQf9j9XTQsAqCWEP9VL5W3KVNtcqo",
  • "initializer": "HesfTj24Eatwy8vvra5UdhX1xJWLeqRM7QdDwjX1xmmk"
}

Hubs

Hubs are a Nina primitive that allow anyone to create a collection of Releases and Posts. Some examples of Hubs are:

  • Artist Pages
  • Label Pages
  • Playlists

Read more about Hubs here.

A Hub has:

  • Collaborators: Accounts that have varying permissions to publish or repost Releases and Posts to the Hub.
  • Releases: Releases that have been published or reposted to the Hub.
  • Posts: Posts that have been published through the Hub. (Posts cannot be reposted yet)

Get All Hubs

Responses

Response samples

Content type
application/json
{
  • "hubs": [],
  • "total": 21
}

Get Hub by publicKey or handle

path Parameters
publicKeyOrHandle
required
string
Examples:
  • tornhawkcity- - A Hub Handle
  • 7Pc1WR8Rxt9UAgphNUA4jd8TXRFWuQhHyAG4jEhzbFkY - A Hub publicKey

The publicKey or handle of the Hub to be fetched

Responses

Response samples

Content type
application/json
{
  • "hub": {},
  • "collaborators": [
    ],
  • "releases": [],
  • "posts": [
    ]
}

Get Collaborators by publicKeyorHandle

path Parameters
publicKeyOrHandle
required
string
Examples:
  • tornhawkcity- - A Hub Handle
  • 7Pc1WR8Rxt9UAgphNUA4jd8TXRFWuQhHyAG4jEhzbFkY - A Hub publicKey

The publicKey of the Hub to be fetched

Responses

Response samples

Content type
application/json
{
  • "collaborators": [
    ],
  • "publicKey": "BY2CWqiV5oUWvLcSfGhcg6a75mNG5uLKLDAKMmaYnuix"
}

Get Posts by publicKeyorHandle

path Parameters
publicKeyOrHandle
required
string
Examples:
  • ninas-picks - A Hub Handle
  • 4QECgzp8hjknK3pvPEMoXATywcsNnH4MU49tVvDWLgKg - A Hub publicKey

The publicKey of the Hub to be fetched

Responses

Response samples

Content type
application/json
{
  • "posts": [
    ],
  • "publicKey": "BY2CWqiV5oUWvLcSfGhcg6a75mNG5uLKLDAKMmaYnuix"
}

Get Releases by publicKeyOrHandle

path Parameters
publicKeyOrHandle
required
string
Examples:
  • tornhawkcity- - A Hub Handle
  • 7Pc1WR8Rxt9UAgphNUA4jd8TXRFWuQhHyAG4jEhzbFkY - A Hub publicKey

The publicKey of the Hub to be fetched

Responses

Response samples

Content type
application/json
{}

Posts

Posts are Blog-like entries published through Hubs.

Posts can contain a reference to a Release

Get All Posts

Responses

Response samples

Content type
application/json
{
  • "posts": [
    ],
  • "total": 21
}

Get Post by publicKey

path Parameters
publicKey
required
string

The publicKey of the Post to be fetched

Responses

Response samples

Content type
application/json
{
  • "post": {
    },
  • "publisher": {
    },
  • "publishedThroughHub": {}
}

Releases

Releases are a Nina primitive that connects metadata and audio files hosted on Arweave to an account on Solana which handles provenance, purchases, and revenue shares.

Relations:

  • exchanges: Exchanges for the Release (open, cancelled, or completed)
  • collectors: Accounts that currently hold the Release
  • hubs: Hubs that the Release has been published or reposted to
  • revenueShareRecipients: Accounts that have a Revenue Share in the Release (each Release can have a maximum of 10 revenueShares with 0-100% share always adding up to 100% across all revenueShares)

Get All Releases

Responses

Response samples

Content type
application/json
{}

Get Release by publicKey

path Parameters
publicKey
required
string
Example: 7tufjgdTJ2mzgnHLctmUd6Hz3ze68dtR3Ekp1ch5rU35

The publicKey of the Release to be fetched

Responses

Response samples

Content type
application/json
{}

Get Collectors by publicKey

path Parameters
publicKey
required
string

The publicKey of the Release to be fetch Collectors for

Responses

Response samples

Content type
application/json
{
  • "collectors": [
    ]
}

Get Hubs by publicKey

path Parameters
publicKey
required
string

The publicKey of the Release to be fetch Hubs for

Responses

Response samples

Content type
application/json
{
  • "hubs": []
}

Get Exchanges by publicKey

path Parameters
publicKey
required
string

The publicKey of the Release to be fetch Hubs for

Responses

Response samples

Content type
application/json
{
  • "exchanges": [
    ]
}

Search

Case insensitive Search endpoint that will return data that matches the query from Hubs, Releases and Artists

Search by query

Operation description markdown.

Request Body schema: application/json

requestBody description

query
string

The body of the search query

Responses

Request samples

Content type
application/json
{
  • "query": "Nina"
}

Response samples

Content type
application/json
{
  • "artists": [
    ],
  • "releases": [
    ],
  • "hubs": []
}