This is a repository of a cloud function to proxy requests to CoinGecko with caching and rate limits, for use in Google Sheets, etc. This prevents your requests from being blocked by the CoinGecko's CDN rate limits. This function code makes requests to the v3 API to obtain market data for all coin, but you can change the URL in the code for your use case.
- Mirror this repo (or a fork) to GCP Cloud Source (docs)
- Setup a cloud function with HTTP trigger using the new GCP code repository
- Setup the environmental variables
CACHE_TTL_SECS
andWAIT_BETWEEN_CALLS_SECS
for the cloud function. Recommended values are900
and10
respectively. - Setup the cloud function with
concurrency
value of1
, and maximum instances for scaling to1
. - Setup a HTTP service with Cloud Run, to run the above function.
- Optionally setup a custom domain for your service.