> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ipworld.io/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> StoryRPC API documentation

## Overview

Storyprovides RPC APIs for interacting with the blockchain through multiple protocols:

<CardGroup cols={3}>
  <Card title="URI over HTTP" icon="globe">
    RESTful API endpoints for simple requests
  </Card>

  <Card title="JSONRPC over HTTP" icon="brackets-curly">
    Standard JSON-RPC 2.0 over HTTP POST
  </Card>

  <Card title="JSONRPC over WebSocket" icon="plug">
    Real-time subscriptions and notifications
  </Card>
</CardGroup>

## Base URL

```bash
https://story-rpc-001.originstake.com
```

## Rate Limiting

<Warning>
  All API endpoints are rate limited to 15 requests per second per IP address.
  Exceeding this limit will result in HTTP 429 (Too Many Requests) responses.
</Warning>

To handle rate limits properly:

* Implement exponential backoff
* Cache frequently requested data
* Batch requests when possible
* Monitor rate limit headers in responses

## Authentication

No authentication is required for public RPC endpoints. However, we recommend:

* Using secure connections (HTTPS)
* Following best practices for key management
* Implementing request signing for sensitive operations

## Request Format

<CodeGroup>
  ```bash URI Style
  curl https://story-rpc-001.originstake.com/block?height=1
  ```

  ```json JSON-RPC
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "block",
    "params": {
      "height": "1"
    }
  }
  ```
</CodeGroup>

## Response Format

All responses follow standard JSON-RPC 2.0 format:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    // Response data
  },
  "error": {
    "code": -32603,
    "message": "Internal error",
    "data": "Detailed error message"
  }
}
```

## Error Codes

| Code   | Description      |
| ------ | ---------------- |
| -32700 | Parse error      |
| -32600 | Invalid request  |
| -32601 | Method not found |
| -32602 | Invalid params   |
| -32603 | Internal error   |

## Best Practices

<AccordionGroup>
  <Accordion title="Performance Optimization">
    * Cache responses when appropriate
    * Use pagination for large result sets
    * Subscribe to WebSocket events instead of polling
  </Accordion>

  <Accordion title="Error Handling">
    * Implement proper error handling
    * Use exponential backoff for retries
    * Monitor response status codes
  </Accordion>

  <Accordion title="Security">
    * Use HTTPS for all requests
    * Validate all responses
    * Implement request signing when needed
  </Accordion>
</AccordionGroup>

## SDKs & Tools

<CardGroup cols={2}>
  <Card title="Story.js" icon="js" href="#">
    Official JavaScript SDK for Story
  </Card>

  <Card title="Story CLI" icon="terminal" href="#">
    Command-line interface for interacting with Story
  </Card>
</CardGroup>

<Note>
  Need help? Join our [Discord](https://discord.gg/storyprotocol) for support or
  check out the [GitHub repository](https://github.com/storyprotocol) for
  examples.
</Note>
