nostr-rest

module
v0.0.0-...-3e81ccd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2023 License: MIT

README

>> 日本語

Nostr REST

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.

Purpose

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.

Mastodon-Compatible API

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.

Compatibility Status

Specification

  • Accounts
    • /v1/accounts/verify_credentials
    • /v1/accounts/{uid}
    • /v1/accounts/{uid}/statuses
  • Timelines
    • /v1/timelines/public

Simple API

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.

Compatibility Status

Specification

Usage Example

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'

Author

Directories

Path Synopsis
api
cmd
mastodon/openapi
Package mopenapi provides primitives to interact with the openapi HTTP API.
Package mopenapi provides primitives to interact with the openapi HTTP API.
openapi
Package openapi provides primitives to interact with the openapi HTTP API.
Package openapi provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL