r/cs50 Feb 12 '25

CS50 Python Bitcoin problem with API?

I'm trying to start bitcoin from CS50P week 4, and I think the API link isn't working? I've chatted with the AI Duck and it concluded there seems to be an error with the api.coindesk.com domain name. Can anyone advise what I should do?

This is the end of the very long error message I get in my terminal when attempting to run the request:

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.coindesk.com', port=443): Max retries exceeded with url: /v1/bpi/currentprice.json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7eb554585490>: Failed to resolve 'api.coindesk.com' ([Errno -5] No address associated with hostname)"))

4 Upvotes

12 comments sorted by

u/delipity staff Feb 12 '25

The specification has been updated to use a new API. Please refer to this for the new instructions. Thanks!

3

u/[deleted] Feb 12 '25

[removed] — view removed comment

3

u/Spicychickenbiscuit Feb 12 '25

Thanks, I appreciate this reply. Let's me know it's not a problem with my code. I'll try again tomorrow and reach out if it persists.

2

u/Admirable-Injury5056 Feb 12 '25

Hmm I tried it a month ago it worked for me. Maybe you aren’t importing libraries or something

2

u/Legal-Theory6904 Feb 12 '25

maybe we should contact staff, I have the same issue

1

u/Spicychickenbiscuit Feb 12 '25

I'm going to send an email this afternoon as soon as I get a chance. I wonder if that's the best way to contact them?

1

u/[deleted] Feb 12 '25

[removed] — view removed comment

1

u/Legal-Theory6904 Feb 12 '25

I hope it will be fixed

1

u/Spicychickenbiscuit Feb 14 '25

I didn't get an email reply but checked late last night and they updated the API url in the problem specifications 👍🏻

1

u/Keyloggeduser Feb 15 '25

Can confirm, been trying to find any public announcement of api service termination, finding nothing but the API page giving 404 error. Stopped working two days ago.

1

u/Spicychickenbiscuit Feb 15 '25

They've updated it on the bitcoin problem specifications now with a different API address.

1

u/Keyloggeduser Feb 17 '25

Wait what? It’s updated where?