
Upstash Has a Free Redis API — Serverless Key-Value Storage Over HTTP
Redis Over HTTP Upstash gives you serverless Redis accessible via simple HTTP requests. No connection management, no drivers needed. Free tier: 10K commands/day. HTTP API (No SDK Needed) curl https://your-endpoint.upstash.io/set/mykey/myvalue \ -H "Authorization: Bearer your_token" curl https://your-endpoint.upstash.io/get/mykey \ -H "Authorization: Bearer your_token" Python import requests URL = " https://your-endpoint.upstash.io " TOKEN = " your_token " HEADERS = { " Authorization " : f " Bearer { TOKEN } " } def redis_set ( key , value , ex = None ): cmd = f " /set/ { key } / { value } " if ex : cmd += f " /ex/ { ex } " return requests . get ( f " { URL }{ cmd } " , headers = HEADERS ). json () def redis_get ( key ): return requests . get ( f " { URL } /get/ { key } " , headers = HEADERS ). json ()[ " result " ] def redis_incr ( key ): return requests . get ( f " { URL } /incr/ { key } " , headers = HEADERS ). json ()[ " result " ] # Usage redis_set ( " visits " , 0 ) redis_incr ( "
Continue reading on Dev.to Tutorial
Opens in a new tab


