# Algotrade.io > The latest BUY and SELL signals for BTC, for subscribers, through the Signals API, webhook alerts and alert emails. New signals are detected between 00:00 and 00:10 UTC. The Signals API has one endpoint, `GET https://api.algotrade.io/signals`, which takes the API key in the `X-API-Key` header. It returns the latest signals for BTC, up to 7, oldest first. - Plan: 5 requests in any 24 hours. `GET https://api.algotrade.io/plans` returns the current price as JSON: `unit_amount` in the currency's smallest unit (cents for USD), `currency`, and `recurring` with the billing interval. - Access: create an account, subscribe at https://algotrade.io/subscription, and copy the API key from https://algotrade.io/docs#auth once signed in. Replacing the key there stops the old one at once. - MCP: `https://api.algotrade.io/mcp` is a read-only remote MCP server (Streamable HTTP) with one tool, `get_signals`, which takes the same `X-API-Key` header and spends the same quota. - Webhooks: subscribers can get each new signal as a POST to an https URL (00:00 to 00:10 UTC). - The algorithm's signals do not constitute investment advice. See the Terms of Service & Financial Disclaimer. ## Docs - [Quick Start](https://algotrade.io/docs.md): access, request, response fields, errors, quota, webhook alerts, the MCP server, key replacement, and the signal encoding - [OpenAPI description](https://algotrade.io/openapi.yaml): the Signals API in OpenAPI 3.0 - [API Docs](https://algotrade.io/docs): the Quick Start with an interactive API reference, which needs JavaScript - [For AI agents](https://algotrade.io/agents.md): the key, quota, errors and webhook alerts for agents, also at https://algotrade.io/agents ## Pages - [Premium Access](https://algotrade.io/subscription): the plan, whose price loads with JavaScript - [Help](https://algotrade.io/help): the plan, contacting support, and answers to common questions - [Home](https://algotrade.io/): what subscribers get and how to start - [AI / ML Model](https://algotrade.io/algorithm): the model behind the signals, which loads with JavaScript - [Contact](https://algotrade.io/contact): a message form for signed-in accounts, which needs JavaScript ## Optional - [Full text](https://algotrade.io/llms-full.txt): this file with the Quick Start and the OpenAPI description - [Terms of Service & Financial Disclaimer](https://algotrade.io/tos) - [Privacy Policy](https://algotrade.io/privacy) ## Quick Start The Signals API returns the latest BUY and SELL signals for BTC to subscribers. ### Access 1. Create an account with **Get started** at the top of any page, and verify your email address. 2. Subscribe on the [Subscription](https://algotrade.io/subscription) page. 3. Sign in and copy your API key from the Auth section of the [API Docs](https://algotrade.io/docs#auth) page. ### Request Send the key in the `X-API-Key` header: ```sh curl -H "X-API-Key: $API_KEY" https://api.algotrade.io/signals ``` ### API Key Every request needs your API key. It is in the Auth section of the [API Docs](https://algotrade.io/docs#auth) page once you sign in. Each account has one key. - Your key also arrives in the `X-API-Key` header of every webhook alert sent to you, so anything that logs your webhook requests holds your key. - You are responsible for keeping your password and account confidential. - If your key may have leaked, replace it. See [Key Rotation](#key-rotation). A missing or unknown key gets a `401`. See [Errors](#errors). ### Response A successful request returns status `200` and JSON like this example, whose values are illustrative: ```json { "message": "You have 4 requests left / 1 day(s).", "data": [ {"Date": "2020-01-01", "Signal": "BUY", "Day": "Wed", "Asset": "BTC"}, {"Date": "2020-01-02", "Signal": "SELL", "Day": "Thu", "Asset": "BTC"} ] } ``` - `message`: how many requests are left in the current 24 hours. - `data`: the latest signals, up to 7, oldest first. - `Date`: the date of the signal, as `YYYY-MM-DD`. - `Signal`: `BUY` or `SELL`. - `Day`: the day of the week of `Date`, such as `Mon`. - `Asset`: the asset the signal is for, `BTC`. ### Errors Errors return JSON with a `message`: - `401` `Provide a valid API key.`: the `X-API-Key` header is missing or holds an unknown key. Send the key from the Auth section of the [API Docs](https://algotrade.io/docs#auth) page. - `402` `This endpoint is for subscribers only.`: the account has no subscription. Subscribe on the [Subscription](https://algotrade.io/subscription) page. - `403` `You have reached your quota of 5 requests / 1 day(s).`: the quota is used up. Wait until 24 hours after the oldest of your last 5 requests. ### Quota Each account can make 5 requests in any 24 hours. A request is allowed again 24 hours after the oldest of the last 5. Each request answered with `200` counts, and its `message` says how many requests are left. Requests answered with `401`, `402`, or `403` do not count. The API sends CORS headers for the Algotrade.io site only, so call it from a server or a script. ### Webhooks Subscribers can also get each new signal as a webhook alert. Set an https URL on the [Alerts](https://algotrade.io/alerts) page. Its host must resolve to public addresses only. When a new signal is detected (00:00 to 00:10 UTC), Algotrade.io sends a `POST` to the URL with a JSON array that holds the signal: ```json [{"Date": "2020-01-03", "Signal": "BUY", "Day": "Fri", "Asset": "BTC", "Perf": 0.1}] ``` - The fields are those of `data`, plus `Perf`, a number. - The `X-API-Key` header holds your API key, so your server can check that the alert came from Algotrade.io. - Each alert is sent once, with a 5 second timeout, and redirects are not followed. ### Webhook Setup 1. Sign in and open the [Alerts](https://algotrade.io/alerts) page. 2. Enter an https URL whose host resolves to public addresses only. - **Sent once.** A failed alert is not sent again. `GET /signals` still returns the latest signals. - **5 second timeout.** Answer within 5 seconds, and do any slow work after you answer. - **No redirects.** Your URL must answer directly. If it answers with a redirect, the alert does not reach the new address. - **Check the key.** Reject any alert whose `X-API-Key` header does not match your API key. To check your own server, send it a request shaped like an alert. This calls only your server, not Algotrade.io, and the values are illustrative: ```sh curl -i -m 5 -X POST "$WEBHOOK_URL" \ -H "Content-Type: application/json" \ -H "X-API-Key: $API_KEY" \ -d '[{"Date":"2020-01-03","Signal":"BUY","Day":"Fri","Asset":"BTC","Perf":0.1}]' ``` Check that: - your server answers within 5 seconds (`-m 5`) and without a redirect; - a request with a wrong `X-API-Key` is rejected; - your parser reads `Signal` as the string `BUY` or `SELL` (see [Side Encoding](#side-encoding)). Webhook alerts are information. What your server does with an alert is set up and controlled by you. ### Key Rotation **Replace key** in the Auth section of the [API Docs](https://algotrade.io/docs#auth) page gives the account a new API key. The old key stops working at once. Webhook alerts carry the new key in their `X-API-Key` header from then on, so update the key your server checks. ### MCP Server `https://api.algotrade.io/mcp` is a read-only remote MCP server for AI agents, over Streamable HTTP. Its one tool, `get_signals`, takes no arguments and returns the `message` and `data` that `GET /signals` returns. Send the API key in the `X-API-Key` header, as with the API. Each call that returns signals counts toward the same 5 requests in any 24 hours. The API's error messages come back as tool errors, and listing the tools needs no key. A client that reads an `mcpServers` config takes the server like this, though the field names vary by client: ```json { "mcpServers": { "algotrade": { "type": "http", "url": "https://api.algotrade.io/mcp", "headers": {"X-API-Key": "YOUR_API_KEY"} } } } ``` ### Side Encoding `Signal` is the string `BUY` or `SELL` in API responses and webhook alerts. Webhook alerts sent before 2026-11-26 could carry `true` or `false` instead, and `false` could stand for a BUY. - Treat `Signal` as `BUY` or `SELL`. Reject or log any other value instead of guessing. - Do not infer a side from `true` or `false` in alerts stored before the change. - `GET /signals` returns the latest signals, up to 7, with `Date` and `Signal` as `BUY` or `SELL`. Use it to correct stored records for those dates. ### Machine-Readable Docs - [OpenAPI description](https://algotrade.io/openapi.yaml) of the Signals API - [This guide in Markdown](https://algotrade.io/docs.md) - [llms.txt](https://algotrade.io/llms.txt), a summary of the site for AI agents, and [llms-full.txt](https://algotrade.io/llms-full.txt) with this guide and the OpenAPI description ## OpenAPI Description ```yaml openapi: 3.0.3 info: title: Algotrade.io Signals API version: '1.0' description: | The latest BUY and SELL signals for BTC, for subscribers. **Access:** create an account at https://algotrade.io, subscribe at https://algotrade.io/subscription, and copy your API key from the Auth section of https://algotrade.io/docs once you are signed in. Send the key in the `X-API-Key` header. **Quota:** 5 requests in any 24 hours per account. A request is allowed again 24 hours after the oldest of the last 5. Requests answered with 401, 402, or 403 do not count. **Errors:** every error returns JSON with a `message`. **Webhooks:** subscribers can also get each new signal as a POST to an https URL. The `WebhookAlert` schema describes the body, and https://algotrade.io/docs.md describes the alerts. termsOfService: https://algotrade.io/tos contact: name: Algotrade.io url: https://algotrade.io/contact servers: - url: https://api.algotrade.io security: - ApiKeyAuth: [] tags: - name: Signals description: BUY and SELL signals paths: /signals: get: tags: - Signals operationId: getSignals summary: Get the latest BUY / SELL signals description: | Returns the latest signals for BTC, up to 7, oldest first. Each request answered with 200 counts toward the quota of 5 requests in any 24 hours. responses: '200': description: '**OK**: the latest signals' content: application/json: schema: $ref: '#/components/schemas/Signals' example: message: You have 4 requests left / 1 day(s). data: - Date: '2020-01-01' Signal: BUY Day: Wed Asset: BTC - Date: '2020-01-02' Signal: SELL Day: Thu Asset: BTC '401': description: '**Unauthorized**: the `X-API-Key` header is missing or holds an unknown key' content: application/json: schema: $ref: '#/components/schemas/Error' example: message: Provide a valid API key. '402': description: '**Payment Required**: the account has no subscription' content: application/json: schema: $ref: '#/components/schemas/Error' example: message: This endpoint is for subscribers only. '403': description: '**Forbidden**: the quota is used up' content: application/json: schema: $ref: '#/components/schemas/Error' example: message: You have reached your quota of 5 requests / 1 day(s). components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-API-Key description: The API key from the Auth section of https://algotrade.io/docs, shown once you sign in schemas: Signals: type: object required: - message - data properties: message: type: string description: How many requests are left in the current 24 hours example: You have 4 requests left / 1 day(s). data: type: array description: The latest signals, up to 7, oldest first maxItems: 7 items: $ref: '#/components/schemas/SignalDatum' SignalDatum: type: object required: - Date - Signal - Day - Asset properties: Date: type: string format: date description: The date of the signal example: '2020-01-03' Signal: type: string enum: [BUY, SELL] description: The side of the signal example: BUY Day: type: string enum: [Sun, Mon, Tue, Wed, Thu, Fri, Sat] description: The day of the week of `Date` example: Fri Asset: type: string enum: [BTC] description: The asset the signal is for example: BTC WebhookSignal: description: A signal in a webhook alert allOf: - $ref: '#/components/schemas/SignalDatum' - type: object required: - Perf properties: Perf: type: number description: A number sent with each webhook alert example: 0.1 WebhookAlert: type: array description: | The body of the POST a webhook alert sends to the account's https URL when a new signal is detected (00:00 to 00:10 UTC). The `X-API-Key` header holds the account's API key. Each alert is sent once, with a 5 second timeout, and redirects are not followed. minItems: 1 maxItems: 1 items: $ref: '#/components/schemas/WebhookSignal' Error: type: object required: - message properties: message: type: string description: What went wrong example: Provide a valid API key. ```