DEVOPS · DEPLOYMENT

Meridian Edge + Railway

Deploy a prediction market consensus microservice to Railway — Python FastAPI, one-click deploy, with your Meridian Edge key as an environment variable.

Connect Railway to Meridian Edge to deploy a production prediction market data service in minutes. Railway handles the infrastructure; your service proxies consensus data to your application.

Requirements

Installpip install fastapi uvicorn requests (in requirements.txt)

Integration Code

main.py — FastAPI Service for Railwaypython
from fastapi import FastAPI
import requests, os

app     = FastAPI()
API_KEY = os.environ["MERIDIAN_API_KEY"]  # set in Railway dashboard
HEADERS = {"X-API-Key": API_KEY}

@app.get("/")
def health():
    return {"status": "ok", "service": "prediction-market-proxy"}

@app.get("/consensus/{sport}")
def consensus(sport: str, limit: int = 10):
    r = requests.get(
        "https://meridianedge.io/api/v1/consensus",
        headers=HEADERS,
        params={"sport": sport.upper(), "limit": limit}
    )
    return r.json()

@app.get("/divergence/{sport}")
def divergence(sport: str, min_div: float = 0.04):
    r = requests.get(
        "https://meridianedge.io/api/v1/consensus",
        headers=HEADERS,
        params={"sport": sport.upper(), "limit": 50}
    )
    events = r.json().get("events", [])
    return {"events": [e for e in events if e.get("divergence_pct",0) >= min_div]}
Procfile + requirements.txt
# Procfile
web: uvicorn main:app --host 0.0.0.0 --port $PORT

# requirements.txt
fastapi
uvicorn
requests

# Railway setup:
# 1. Push to GitHub
# 2. New project → Deploy from GitHub
# 3. Add MERIDIAN_API_KEY env variable

Try it — API key in 10 seconds

Push to GitHub, connect Railway, add your MERIDIAN_API_KEY environment variable, and deploy in 2 minutes.

View Plans → API Reference

Frequently Asked Questions

How do I deploy a prediction market service to Railway?
Create a FastAPI app (or any WSGI/ASGI app) that calls the Meridian Edge API. Add a Procfile and requirements.txt. Connect your GitHub repo to Railway, set the MERIDIAN_API_KEY environment variable, and deploy.
What does Railway + Meridian Edge cost?
Railway has a $5/month credit for new projects. Meridian Edge starter tier: 100 calls/day. Get a key at meridianedge.io/#pricing.