Connecting Your Project Data to RWA.io Insights
Connecting your project data to RWA.io Insights via API allows you to track key metrics, monitor performance, and gain insights into user engagement and financial indicators. This API integration allow projects to upload custom or predefined time-series data directly to the RWA.io Insights platform, enabling better analytics and visibility within the RWA ecosystem.
By following this guide, you’ll learn how to:
- Set up your project with API access on RWA.io Insights
- Use available and custom time-series options to monitor project-specific metrics
- Ensure data formatting and timestamp accuracy for smooth integration
- Collaborate with team members on data management
Whether you’re tracking unique wallets, transaction volumes, or custom financial indicators, this API integration will help you showcase your project data on RWA.io insights.
Step 1: Initial Project Setup
- Locate Your API Key and Documentation
- Start by logging into your RWA.io Insights account and navigating to your account dashboard.
- You can find your API Key and API Documentation under the tabs at your dasboard.
- These credentials are necessary for authenticating API requests and accessing detailed endpoint specifications for your project.
- Navigate to Your Project's API Dasboard
- Go to your project page on RWA.io Insights by using your project slug in the URL structure (for example,
https://insights.rwa.io/project/your-project-slug
). - On this page, locate the API Guide tab, which provides a detailed view of available time series, project-specific data options, and step-by-step API setup instructions.
- Go to your project page on RWA.io Insights by using your project slug in the URL structure (for example,
Once you have your API Key, you can proceed to configure and upload time-series data directly from your project’s dashboard.
Authentication
To securely connect with the RWA.io API, include your API key in the request headers. This key ensures that only authorized users can send or manage data for your project.
Request Header Setup:
Add the following header in all requests:
x-api-key: your-api-key
Replace your-api-key
with the API key from your dashboard. This authentication step is mandatory for all API calls and protects your project’s data.
Example Code for API Key Integration:
Here’s a sample cURL
request to demonstrate how to authenticate with the API using your API key:
curl -X GET "https://api.rwa.io/your-endpoint" \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json"
In this example:
https://api.rwa.io/your-endpoint
is the API endpoint you are calling.- The
x-api-key
header contains your unique API key.
Using this header allows you to securely interact with your project data and access various time series available through the RWA.io Insights API.
Step 2: Available Time Series Overview
The RWA.io Insights API provides various pre-defined time series for mainnet and testnet environments, allowing projects to track key metrics like wallet activity, transaction volume, and market valuation. Additionally, you have the flexibility to create custom time series tailored to your specific project needs. Here’s a breakdown of each option:
Mainnet Time Series
The following time series are available by default for mainnet projects:
- Unique Wallets (Daily interval)
- Tracks the number of unique wallet addresses interacting with your project each day. Useful for measuring user engagement and adoption over time.
- Daily Transactions (Daily interval)
- Measures the total number of transactions involving your project daily. Helps to monitor activity levels and project usage.
- Total Value Locked (TVL) (Hourly interval)
- Tracks the total value locked in your project in real-time. Commonly used in DeFi to indicate the financial commitment within a protocol.
- Total Volume (Hourly interval)
- Measures trading or transaction volume associated with your project. Essential for understanding the liquidity and transaction flow.
- Market Capitalization (Hourly interval)
- Tracks the total market value of your project’s assets. Useful for projects looking to gauge market interest and valuation.
- Price (Hourly interval)
- Monitors asset prices associated with your project. Important for financial analysis and value assessment.
These mainnet time series provide a standardized way to track core metrics, making it easy to benchmark against other projects on RWA.io.
Testnet Time Series
The API also supports default time series for testnet environments, allowing projects to trial data collection before going live:
- Unique Wallets (Daily interval)
- Tracks unique wallets interacting with your project on the testnet. Useful for initial testing of user engagement metrics.
- Daily Transactions (Daily interval)
- Measures daily transaction counts on the testnet. This helps simulate and validate transaction volume before deploying on mainnet.
Custom Time Series
In addition to predefined time series, RWA.io allows you to create custom time series tailored to your project’s specific requirements. This flexibility enables you to track metrics unique to your project or financial structure.
- Creating a Custom Time Series
- To set up a custom time series, navigate to the Time Series Management section in your project’s API Guide tab.
- Click on “Create Time Series” and fill in the required fields.
- Defining Custom Time Series Parameters
- Time Series Name: Give your time series a descriptive name. Choose a name that clearly indicates the metric you intend to track.
- Blockchain Network: Select the network (mainnet or testnet) where this time series will apply.
- Units: Specify the units of measurement (e.g., USD, count, gwei) for the data you will upload. This ensures consistency in data interpretation and reporting.
Custom time series allow data tracking and more tailored analytics for projects with unique requirements. RWA.io supports up to 50 custom time series per project, making it suitable for a wide range of data needs.
Step 3: Managing and Configuring Time Series
Once your time series are set up, you can manage data uploads, updates, and deletions using the RWA.io API. This step covers how to create a new time series, add data, and modify existing entries to ensure your project metrics are current and accurate.
Creating a Time Series
If you haven’t created a time series yet, follow these steps:
- Go to Time Series Management
- On your project page in the API Guide tab, navigate to the Time Series Management section.
- Select Create Time Series to define a new metric.
- Define the Parameters
- Time Series Name: Choose a clear, descriptive name for easy identification.
- Type: Select mainnet or testnet, depending on where you want to apply this time series.
- Chain Name: Specify the blockchain network if your metric is chain-specific.
- Units: Define the unit of measurement (e.g., USD, count) for this time series.
- After setting these parameters, save the time series, and it will appear in your list of available metrics.
Adding Data to Time Series
To add data to an existing time series, use the POST /project-time-series/data/add
endpoint. This action allows you to input new data points, providing a continuous feed of metrics to your project.
- Obtain the Time Series ID
- Each time series has a unique ID (e.g.,
6720c86885745176ab11895d
) displayed in the API Guide. Use this ID to specify the time series you’re updating.
- Each time series has a unique ID (e.g.,
- Prepare Data Points
- Timestamp: Ensure timestamps are in UNIX milliseconds format and align with hourly or daily intervals.
- Value: Include the data value you want to add for each timestamp.
- Example Request to Add Data
Here’s an example cURL
command to add data to a time series:
curl -X POST "https://api.rwa.io/project-time-series/data/add" \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"tsId": "6720c86885745176ab11895d",
"records": [
{"timestamp": 1727776800000, "value": 1000000},
{"timestamp": 1727780400000, "value": 1050000}
]
}'
In this example:
tsId
specifies the time series ID.records
is an array of timestamped values you’re adding.
Updating and Deleting Data
To manage existing data, you can update or delete records as needed.
- Updating Data Points
- Reuse the
/project-time-series/data/add
endpoint to overwrite existing timestamps with new values. Simply specify the timestamp and value, and the API will replace the old entry.
- Reuse the
- Deleting Data Points
- Use the DELETE
/project-time-series/data/delete
endpoint to remove specific records. This is useful for clearing outdated or incorrect data entries.
- Use the DELETE
- Example Request to Delete Data:
curl -X DELETE "https://api.rwa.io/project-time-series/data/delete" \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"tsId": "6720c86885745176ab11895d",
"timestamps": [1727776800000, 1727780400000]
}'
In this example:
1. tsId
specifies the time series ID you’re modifying.
2. timestamps
is an array of UNIX millisecond timestamps of the records to delete.
These management functions ensure your time series data is up-to-date and accurately reflects your project’s metrics. Properly configuring and maintaining your time series allows for effective tracking and analysis on RWA.io Insights.
Step 4: Formatting Data and Timestamps
Proper data and timestamp formatting is essential for successful API integration with RWA.io Insights. The API requires specific formatting to ensure consistency and accuracy across project metrics. This section provides guidelines and examples for correctly formatting your data and timestamps.
Timestamp Guidelines
- Format: Timestamps must be in UNIX milliseconds.
- Example:
1727776800000
(October 1, 2024, 10:00:00 GMT)
- Example:
- Intervals: Timestamps should align with hourly or daily intervals, depending on your time series settings.
- Hourly: Timestamps should be at the start of each hour (e.g., 10:00:00, 11:00:00).
- Daily: Timestamps should be at the start of each day (e.g., 00:00:00).
- Timezone: All timestamps must be in UTC/GMT to ensure consistency across global data.
Valid Timestamp Examples
Here are examples of correctly formatted timestamps for both hourly and daily intervals:
- Hourly Interval Example:
- October 1, 2024, 10:00:00 GMT →
1727776800000
- October 1, 2024, 11:00:00 GMT →
1727780400000
- October 1, 2024, 10:00:00 GMT →
- Daily Interval Example:
- October 1, 2024, 00:00:00 GMT →
1727731200000
- October 2, 2024, 00:00:00 GMT →
1727817600000
- October 1, 2024, 00:00:00 GMT →
These timestamps, in UNIX milliseconds, provide accurate hourly or daily intervals, as required by the API.
Data Format Rules
- Interval Consistency: Ensure that all data points for a specific time series are uploaded in the designated interval (either hourly or daily).
- Precision: Use precise values for each data point to maintain accuracy, particularly for metrics like volume or price.
- Data Type: Make sure values are formatted as numbers (e.g., integers or floating-point values) appropriate to the metric’s unit (e.g., USD, ETH, transactions).
Example Data Payload
Here’s a sample payload for adding data with correctly formatted timestamps and values:
{
"tsId": "6720c86885745176ab11895d",
"records": [
{"timestamp": 1727776800000, "value": 1000000}, // October 1, 2024, 10:00:00 GMT
{"timestamp": 1727780400000, "value": 1050000} // October 1, 2024, 11:00:00 GMT
]
}
In this example:
timestamp
values are in UNIX milliseconds format, aligned to hourly intervals.value
represents the metric value (e.g., trading volume, market cap) for each timestamp.
By following these formatting and timestamp guidelines, you ensure that your data integrates smoothly with RWA.io Insights, providing reliable metrics for analysis.
Step 5: Developer Collaboration
RWA.io Insights allows project owners to invite additional developers to collaborate on managing project data via the API. This feature is useful for projects that require a team to maintain, update, and analyze their time-series metrics. Collaborators receive full API access, enabling them to manage time series and project settings as needed.
Inviting Team Members
- Access Project Settings:
- In your RWA.io Insights project dashboard, navigate to the Project Settings section or the API Guide tab.
- Invite a Developer:
- Look for the Invite Developer button. Enter the email address or username of the developer you wish to invite.
- Ensure that the invitee has an RWA.io account to receive and accept the invitation.
- Grant Permissions:
- Upon accepting the invitation, the developer gains full API access to the project.
- This includes permissions to add, update, and delete time series data, as well as manage other project settings.
Permissions for Collaborators
Invited developers can:
- Access the API Documentation:
- Collaborators can view and use the API documentation to understand endpoints, request formats, and data guidelines.
- Create and Manage Time Series:
- Developers can create new time series, set parameters, and update or delete data points as required for project analysis.
- Manage Project Settings:
- Collaborators have the capability to adjust project configurations, including time series setup and data access settings.
These permissions allow team members to effectively contribute to the project’s data management and analytics, ensuring that metrics remain up-to-date and aligned with the project’s goals.
Conclusion
Integrating your project data with RWA.io Insights via API provides powerful capabilities for tracking and analyzing key metrics. By following this guide, you can set up, manage, and customize time-series data to improve your project’s visibility and performance in the RWA.io ecosystem.
Need help?
If you're stuck or encounter issues during the domain verification process, feel free to contact RWA.IO support or your domain registrar for additional assistance.