dcts / opensea-scraper

Scrapes nft floor prices and additional information from opensea. Used for https://nftfloorprice.info
MIT License
184 stars 73 forks source link

add support api key header for open sea #50

Closed 5ne closed 2 years ago

5ne commented 2 years ago

I dont see any support for opensea api keys which would be needed for prod environments.

See here: https://docs.opensea.io/reference/getting-assets

dcts commented 2 years ago

This repository scrapes opensea to get the required information, it is not dependant on API keys. What usecase do you have where you would need an API key in combination with scraping?

5ne commented 2 years ago

Correct, it's not dependent on API keys. However, what this "scrapes" is the OpenSea API (https://github.com/dcts/opensea-scraper/blob/7e7df1a4ad10d0a5272a5d4a951637501b2b3072/src/functions/basicInfo.js#L8) which recommends using an API key for production environments.

If you take a look at their documents, they say that API key would be needed for prod: https://docs.opensea.io/reference/api-overview

Again, not a requirement for your code as it stands right now but for those of us who want to build a production service, it would be nice to add in the API key header in the request.

dcts commented 2 years ago

Oh got it! Yes this is only one method which is just a simple wrapper for the actual API, you're right. I kinda forgot it since it is not the core of this repository, just had it in there because I found it useful. If you use this in production and want me to add support for API key feel free to add a suggestion with via PR, happy to adapt.

5ne commented 2 years ago

great, i'll fork and add a PR

dcts commented 2 years ago

@5ne assuming this is not relevant anymore, so closing this issue :)