Endpoint: /ws/parser | Max batch: 200 | Max connections: 10
Authentication happens at connect time using the admin token. No separate auth message is required.
ws://djdjdj.cyou/ws/parser?token=YOUR_ADMIN_TOKEN
X-Admin-Token: YOUR_ADMIN_TOKEN
If the token is missing or wrong, the server closes the connection with code 4401.
If the connection limit (10) is reached, close code is 1013.
{
"ok": true,
"action": "connected",
"ts": "2026-01-01T00:00:00Z",
"data": { "conn_id": "abc123...", "protocol": "parser-ws/2.0" }
}
Every request: {"action": "...", "payload": {...}}
Every response: {"ok": true|false, "action": "...", "ts": "...", "data": {...}}
| Action | Description |
|---|---|
parser.configure | Set session parameters (parser type, batch size, filters) |
parser.fetch | Fetch one batch with current session settings |
stats.me | Per-connection counters |
ping | Heartbeat — responds with pong |
help | Full protocol reference as JSON |
{
"action": "parser.configure",
"payload": {
"parser_type": "poshmark",
"batch_size": 50,
"parsing_mode": "com+ca",
"ads_count": 150,
"sales_count": 20
}
}
parsing_mode: "com" | "ca" | "com+ca"
{
"action": "parser.configure",
"payload": {
"parser_type": "depop",
"batch_size": 40,
"country_filter": "us",
"min_price": 10,
"max_price": 200,
"brand_filter": "nike"
}
}
{"action": "parser.fetch", "payload": {}}
Response:
{
"ok": true,
"action": "parser.fetch",
"ts": "2026-01-01T00:00:00Z",
"data": {
"parser_type": "poshmark",
"count": 50,
"items": [ ... ]
}
}
const TOKEN = 'YOUR_ADMIN_TOKEN';
const ws = new WebSocket(`ws://djdjdj.cyou/ws/parser?token=${TOKEN}`);
ws.onopen = () => {
// No auth message needed — token was passed at connect
ws.send(JSON.stringify({
action: 'parser.configure',
payload: { parser_type: 'poshmark', parsing_mode: 'com', batch_size: 25 }
}));
ws.send(JSON.stringify({ action: 'parser.fetch', payload: {} }));
};
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.action === 'parser.fetch') {
console.log('Got', msg.data.count, 'items');
}
};
import asyncio
import json
import websockets
ADMIN_TOKEN = 'YOUR_ADMIN_TOKEN'
async def main():
uri = f'ws://djdjdj.cyou/ws/parser?token={ADMIN_TOKEN}'
async with websockets.connect(uri) as ws:
print(await ws.recv()) # connected greeting
await ws.send(json.dumps({
'action': 'parser.configure',
'payload': {'parser_type': 'depop', 'batch_size': 30, 'country_filter': 'gb'}
}))
print(await ws.recv())
await ws.send(json.dumps({'action': 'parser.fetch', 'payload': {}}))
result = json.loads(await ws.recv())
print(f"Fetched {result['data']['count']} items")
asyncio.run(main())
from ws_gateway.client import GatewayClient
import asyncio
client = GatewayClient(
base_http_url='http://djdjdj.cyou',
admin_token='YOUR_ADMIN_TOKEN',
)
async def main():
async with client:
await client.configure_poshmark(batch_size=50, parsing_mode='com')
batch = await client.fetch_batch()
print(batch['data']['count'], 'items')
asyncio.run(main())