Design comparison
Solution retrospective
was it really possible to search by domain? I mean, was not it an api to search by Ip addresses? also, Ipify api does not work on brave browser.
Community feedback
- @animalchin45Posted almost 2 years ago
Yes you can search by domain. I made this work by first validating that the search term is a valid ip address or not. If the term is validated as an IP address then the request to ipify will be by IP address, else the request is for a domain. If you send your request with the IP value as null then you can search by domain name.
if (type) { const response = await ipify.get('/country,city', { params: { apiKey: KEY, ipAddress: term, }, }) return response.data } else { const response = await ipify.get('/country,city', { params: { apiKey: KEY, ipAddress: null, domain: term, }, }) return response.data } }```
0@zazamirotadzePosted almost 2 years agoI have seen your solution. Yes it can search a famous domain like google.com. But It can not find many lesser known domains. I have also seen other peoples solutions but the results are the same.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord