API and WebSocket
Authenticate with your API key, manage what you track over REST, and stream your feed over one WebSocket.
On this page
Doggo Top Dog
Everything here uses the API key from your Account page and acts on your account.
WebSocket feed#
- ConnectTo
wss://news.bark.gg/ws. - Log inSend
login <your api key>. - Stay connectedSend
pingregularly; Bark answerspong.
Each alert is one JSON object; its tags hold the data, such as NEWS_TYPE and PREFERRED_TRADING_URL (the token on your platform). Every kind: WebSocket messages. You get what the Terminal & API switches in Settings → Delivery allow, on up to 10 connections per key.
const ws = new WebSocket("wss://news.bark.gg/ws");
ws.onopen = () => ws.send(`login ${process.env.BARK_API_KEY}`);
setInterval(() => ws.send("ping"), 15_000);
ws.onmessage = ({ data }) => {
if (data === "pong") return;
const alert = JSON.parse(data);
console.log(alert.time, alert.title, alert.tags.NEWS_TYPE);
};REST API#
The base address is https://news.bark.gg; send your key in the X-API-KEY header. Every endpoint: REST API reference.
| Call | What it does |
|---|---|
GET /settings/<collection> | Lists what you track, such as wallets |
PUT /settings/<collection> | Tracks or updates something |
DELETE /settings/<collection> | Stops tracking it |
POST /settings/detect | Says what pasted text is and how to track it |
GET /news/export | Your feed's history, page by page (free, 60 calls a minute) |
GET /check-twitter?handle=… | Looks up an X account (100 credits) |
Add entityId and channelId to change a server's channel or a group's topic instead of your own feed. Errors: 400 bad request, 404 not found, 409 plan limit reached.
# Track a wallet, then list your wallets
curl -X PUT "https://news.bark.gg/settings/wallets" \
-H "X-API-KEY: $BARK_API_KEY" -H "Content-Type: application/json" \
-d '{"address": "<wallet address>", "label": "whale 3"}'
curl "https://news.bark.gg/settings/wallets" -H "X-API-KEY: $BARK_API_KEY"AI assistants#
Use the MCP server.