#Request isnt validating /api/stream/game/{id}

10 messages · Page 1 of 1 (latest)

glossy void
#

My goal is to stream the moves of the current chess game..
Unfortunately none of my request are validating and when i enter the endpoint via browser it downloads a file with the name of the game id instead of a response body of the moves or anything else

sly estuary
#

Maybe it's because your browser doesn't request application/x-ndjson...
Many of the endpoints aren't supposed to be used via a web browser,
but by other http clients from applications/scripts.

glossy void
#

Ah ok

#

i think i fixed it

#

it seems it works better on desktop based apps rather reqbin

sly estuary
#

Here's example withcurl,

curl --header "accept: application/x-ndjson" https://lichess.org/api/stream/game/b3rvTSpI
{"id":"b3rvTSpI","variant":{"key":"standard","name":"Standard","short":"Std"},"speed":"classical","perf":"classical","rated":true,"fen":"5rk1/pp1b2pp/4p3/4Pn1Q/3P3q/2P3N1/PP5P/R1B3K1 w - - 2 21","player":"white","turns":40,"startedAtTurn":0,"source":"pool","status":{"id":20,"name":"started"},"createdAt":1680039184848,"lastMove":"e7f5","players":{"white":{"user":{"name":"antonioMBA","id":"antoniomba"},"rating":2147},"black":{"user":{"name":"juansonhallucinating","id":"juansonhallucinating"},"rating":2120}}}
{"fen":"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1","wc":1800,"bc":1800}
...
glossy void
#

do you have the endpoint for a game creation?

#

and fetching that id