Mocked credit card transactions Websocket API for experimental/educational purposes.
This project is a simple credit card transactions Websocket API. It is a mock of a real API that would be used to get credit card transactions, useful for experimental/educational purposes, such as testing and developing ML models for fraud detection.
The websocketAPI has two channels:
heartbeat: for checking if the connection is alivetransactions: for getting credit card transactions in realtime
Run make run to start the API locally.
The API will be available at ws://localhost:9999/v1.
To subscribe to a channel, you need to send a message to the server with the following format:
{
"method": "subscribe",
"params": {
"channel": "transactions"
}
}{
"channel": "transactions",
"data": [
{
"id": "11df919988c134d97bbff2678eb68e22",
"timestamp": "2024-01-01T00:00:00Z",
"cc_number": "4473593503484549",
"category": "Grocery",
"amount_usd_cents": 10000,
"latitude": 37.774929,
"longitude": -122.419418,
"country_iso": "US",
"city": "San Francisco",
}
]
}{
"channel": "heartbeat",
"data": {
"status": "ok"
}
}