I’m trying to use Coinranking’s API to train on my Vue.js new skills and I’m trying to create a form where you can search for coins by names (using axios).
I’m currently able to access all data and seeing the documentation it doesn’t seem to be possible so simply. It seems you can only look for a coin using its “id”.
Is there a way to search by name without having to manually associate names with ids?
Thanks in advance for answers and sorry for the beginner’s question that may seem dumb.
Are you already using the v2 version of our API? Check out the documentation here.
You can do that with the Get search suggestions endpoint.
With that endpoint you could pass down a coin name or symbol and it will return the 5 best results, with an added bonus that it will return exchanges and markets too.
Hi @nickpater,
No I’m not using the V2 version (though that since it was a beta it may not be very stable yet), I guess I will since what you are suggesting seems to fit perfectly to what I’m trying to do!
Thanks a lot for your quick answer I will get down on it quickly and will let you know!
Well… After many attempts to connect to the V2 API I’m hitting a wall.
The documentation here says the Authentication to the API is performed via a custom HTTP header. I’ve tried setting up those headers (I got my API key) in many ways (using axios’ documentation as well as other resources) but keep getting CORS issues, the main one being “Access-Control-Allow-Origin header is missing” (translated from French) followed by a network error.
So I’m still much of a beginner in this field and looked for answers but it seems to me that this header is supposed to be set on server side (which I don’t have access to of course) and not client side.
I’m developing on localhost for the moment, but I don’t know if that has anything to do with it.