# HTTP Example

The TX Stream API is a streaming service and does not expose a direct HTTP equivalent.

If you need real-time transaction monitoring, use the TX Stream gRPC service.

If you need transaction submission, use the main NextBlock HTTP, gRPC, or QUIC APIs instead.

## Overview

Since the TX Stream API is gRPC-only, an HTTP-based trading bot integration usually looks like this:

1. **Use TX Stream gRPC** for real-time monitoring
2. **Use the main HTTP API** for transaction submission and tip floor monitoring

## Recommendation

For trading bot applications that need fast transaction detection for sniping new DEX launches, the gRPC TX Stream API is strongly recommended due to its real-time streaming capabilities.

### Use gRPC TX Stream API (Recommended)

For trading bot transaction monitoring, use the TX Stream gRPC API with one of these examples:

* [Go TX Stream Example](/api/tx-stream/golang.md) - Complete Go implementation
* [TypeScript TX Stream Example](/api/tx-stream/typescript.md) - Node.js implementation
* [Rust TX Stream Example](/api/tx-stream/rust.md) - Rust with Tonic

There is currently no Python TX Stream example in this docs section.

### HTTP API Integration

You can use the existing NextBlock HTTP API endpoints for transaction submission:

<pre class="language-bash"><code class="lang-bash"><strong># Submit transactions to NextBlock
</strong>curl -X POST https://frankfurt.nextblock.io/api/v2/submit \
  -H "Content-Type: application/json" \
  -H "Authorization: your-api-key-here" \
  -d '{
    "transaction": {
      "content": "base-64-encoded-transaction"
    }
  }'

<strong># Get tip floor data for optimization
</strong>curl -X GET https://frankfurt.nextblock.io/api/v2/tipfloor \
  -H "Authorization: your-api-key-here"
</code></pre>

## Available HTTP Endpoints

For transaction submission and tip floor data:

* **Frankfurt**: `https://frankfurt.nextblock.io`
* **Amsterdam**: `https://amsterdam.nextblock.io`
* **London**: `https://london.nextblock.io`
* **Singapore**: `https://singapore.nextblock.io`
* **Tokyo**: `https://tokyo.nextblock.io`
* **New York**: `https://ny.nextblock.io`
* **Salt Lake City**: `https://slc.nextblock.io`
* **Dublin**: `https://dublin.nextblock.io`
* **Vilnius**: `https://vilnius.nextblock.io`

## Best Practices

1. **Use TX Stream gRPC for real-time monitoring**: this is the actual streaming interface
2. **Use HTTP, gRPC, or QUIC for submission**: pick the main API transport that matches your needs
3. **Monitor tip floors**: use the tip floor endpoint to optimize transaction tips
4. **Choose the closest endpoint**: lower network latency generally improves performance
5. **Handle rate limits and retries**: implement appropriate client-side error handling


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nextblock.io/api/tx-stream/http.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
