📊Data API

Overview

The Data API provides read-only access to query and browse intellectual property assets across the Molecule Protocol. Use these queries to build marketplaces, token screeners, portfolio trackers, and discovery interfaces for decentralized science projects.

Features:

  • Query IP-NFTs (Intellectual Property NFTs) and their metadata

  • Browse IP Tokens (IPTs) with market data

  • Access trading metrics and liquidity information

  • Filter, sort, and paginate results

  • Build data-driven applications


Authentication

All Data API requests require an API key.

Obtaining an API Key

To request an API key:

  1. Contact the Molecule team

  2. Provide your intended use case

  3. You'll receive your API key

Using Your API Key

Include the API key in all requests using the x-api-key header:


API Endpoint


Queries

List IP-NFTs

Query and browse all IP-NFTs on the platform with filtering, sorting, and pagination.

GraphQL Query:

Parameters:

Parameter
Type
Description

limit

Int

Maximum number of results (recommended: 20-50)

skip

Int

Number of results to skip (for pagination)

sortBy

IPNFTSortBy

Field to sort by (e.g., createdAt, mintedAt)

sortOrder

SortOrder

Sort direction: asc or desc

filterBy

IPNFTFilterBy

Filter criteria (owner, chainId, etc.)

Example Request (curl):

Response Example:


Get Single IP-NFT

Retrieve detailed information about a specific IP-NFT by its ID.

GraphQL Query:

Example Request:


List IP Tokens (IPTs)

Query and browse all IP Tokens with their associated IP-NFTs and market data.

GraphQL Query:

Parameters:

Parameter
Type
Description

limit

Int

Maximum number of results

skip

Int

Number of results to skip (for pagination)

sortBy

IPTSortBy

Field to sort by (e.g., createdAt, holderCount)

sortOrder

SortOrder

Sort direction: asc or desc

filterBy

IPTFilterBy

Filter criteria (ipnftId, l2TokenAddress, etc.)

Example Request (curl):

Response Example:


Get Single IP Token

Retrieve detailed information about a specific IPT by its ID.

GraphQL Query:


Query Markets

Access trading and market data for IP Tokens.

GraphQL Query:

Example - Get Markets by Trading Volume:


Common Patterns

Pagination

Use skip and limit for pagination:

Sorting

Sort results by any field:

Filtering

Filter results by specific criteria. The API supports both direct field filtering and nested relation filtering.

Basic Filtering

Filter by owner (using user ID):

Filter by chain:

Filter IPTs by IPNFT:

Nested Relation Filtering

The API supports filtering by nested relation properties for more flexible queries.

Filter IP-NFTs by owner address:

Filter IP-NFTs by owner ID:

Filter markets by chain properties:

Filter markets by token symbol:

Filter IPTs by IPNFT owner (deeply nested):

Filter IPNFT metadata by research lead:

Filter IPT metadata by original owner:

Combining Filters

You can combine multiple filters in a single query. All filters are combined with AND logic - results must match all criteria.

Combine scalar and relation filters:

Combine multiple relation filters:

Combine nested relation filters:


Response Types

IPNFT Type

IPT Type

Market Type


Example Use Cases

Building a Marketplace UI

Token Screener / Price Tracker

Portfolio Tracker


Advanced Filtering

Relation Filtering vs Direct Filtering

The Data API supports two approaches to filtering:

  1. Direct Field Filtering: Filter by the ID of a related entity

  2. Relation Filtering: Filter by properties of related entities

Both approaches work and can be used based on your needs.

Example - Finding IP-NFTs by Owner:

Multi-Level Nested Filtering

You can filter through multiple levels of relations:

Available Relation Filters

Query Type
Relation Field
Supported Filters
Example

ipnfts

owner

id, address

owner: { address: "0x..." }

ipnfts

metadata

All metadata fields

metadata: { topic: "Oncology" }

ipts

ipnft

All IPNFT filters

ipnft: { owner: { address: "0x..." } }

ipts

metadata

All IPT metadata fields

metadata: { symbol: "VITA" }

markets

chain

chainId, name

chain: { chainId: 1 }

markets

token

All IPT filters

token: { metadata: { symbol: "..." } }

iptMetadata

originalOwner

id, address

originalOwner: { address: "0x..." }

ipnftMetadata

researchLead

name, email

researchLead: { email: "..." }

Filter Matching

All filters use exact equality matching by default. For example:


Error Handling

Common Errors

Status Code
Error
Description

401

Unauthorized

Missing or invalid API key

400

Bad Request

Invalid query syntax or parameters

404

Not Found

Requested resource doesn't exist

500

Internal Server Error

Server error - retry the request

Troubleshooting

401 Unauthorized Error:

  • Verify x-api-key header is included

  • Check that your API key is valid and not expired

  • Ensure no typos in the API key

Empty Results:

  • Check filter criteria - may be too restrictive

  • Verify the chainId if filtering by chain

  • Try removing filters to see all results

GraphQL Errors:

  • Check query syntax is valid

  • Ensure field names match the schema

  • Verify variable types match parameter types


Getting Support

For questions or issues with the Data API:


Last updated: December 2024

Last updated