Zmalski / NHL-API-Reference

Unofficial reference for the NHL API endpoints.
MIT License
263 stars 20 forks source link

Draft info #20

Open dsaladbar617 opened 7 months ago

dsaladbar617 commented 7 months ago

I have been trying to figure out how to display the picks for specific draft years but can't figure it out. If anyone figures it out please advise!!

alanryder commented 7 months ago

This query returns draft details for the draft in {draft_year): https://records.nhl.com/site/api/draft?cayenneExp=draftYear={draft_year}

e.g. https://records.nhl.com/site/api/draft?cayenneExp=draftYear=2016

dsaladbar617 commented 7 months ago

@alanryder you are amazing thank you!

dsaladbar617 commented 7 months ago

One question thought. I believe that this resource is being blocked by cors from being used in a locally developed website. Do you know of any way to get around this by chance?

alanryder commented 7 months ago

Sorry, but no.

willrees23 commented 6 months ago

Have you taken a look at https://corsproxy.io/?

Example URL: https://corsproxy.io/?<URL>

The website also provides a code example:

const url = 'https://corsproxy.io/?' + encodeURIComponent('https://api.domain.com/...');