This project aims to treat Nostr as a microblog and create a server that provides a REST API. It is still a work-in-progress project, and we are looking for individuals to collaborate on its implementation.
When trying to use Nostr on mobile devices, the following issues may arise:
- The need to connect to multiple relays and communicate large amounts of data.
- Lack of notification mechanisms, making it difficult to be aware of reactions.
- Limited choices for client applications.
To address these issues, we aim to resolve them by building a REST API server as a gateway instead of directly accessing relays.
Implementing a REST API that adheres to the Mastodon API specification is the primary goal of this project. While there are differences in data structures between Mastodon and Nostr, we believe that providing Mastodon API compatibility by accommodating these differences will help achieve our goal.
- Accounts
- /v1/accounts/verify_credentials
- /v1/accounts/{uid}
- /v1/accounts/{uid}/statuses
- Timelines
- /v1/timelines/public
Since the Mastodon-compatible API may have performance-related issues, we are also considering creating a simplified API and allowing clients to create their own.
A sample server reflecting the current implementation status is deployed, so you can refer to it to see what kind of data can be obtained.
# Retrieve Nostr posts by the author in Mastodon API format
curl --request GET \
--url https://nostr-rest-ervoyfxxqq-an.a.run.app/api/v1/accounts/776ea4437354381f14a720be3c476937dce7257ed1073e54a192dbc99f3b7ecc/statuses \
--header 'Authorization: Bearer npub1wah2gsmn2sup7998yzlrc3mfxlwwwft76yrnu49pjtdun8em0mxq6appzu' \
--header 'Content-Type: application/json'