mmarkin / GeoIP

ESP8266 and ESP32 library to get geographical and timezone information from WiFi network's IP address
MIT License
1 stars 0 forks source link

How to use with ipapi.co API key? #1

Open dceriman opened 1 month ago

dceriman commented 1 month ago

Hi Mitch, Not so much an issue, more like a question. I am using paid option for ipapi.co, but if i just replace the url in c file things are not working. DO you have example with using the API key provided by ipapi?

mmarkin commented 1 month ago

Hi Dragan

Thanks for your interest in my library. Sorry, I have never used ipapi.co with a paid subscription so I'm not sure how to add a key to the HTML request. There are lots of servers that find the location from an IP address, but I picked ipapi.co for my library because it doesn't require setting up an account and their free plan is more than enough for my applications.

I had a quick look through ipapi.co's documentation and couldn't find an example of an HTML request that includes a key. Their tech support is very good, though, so you could try contacting them directly to see if they can be of assistance.

Mitch

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free.www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 1:06 PM Dragan Ceriman @.***> wrote:

Hi Mitch, Not so much an issue, more like a question. I am using paid option for ipapi.co, but if i just replace the url in c file things are not working. DO you have example with using the API key provided by ipapi?

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVRWOJJ23UTCQM5REGABS3ZTDRTXAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DIOBUGIYTSOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

dceriman commented 1 month ago

Mitch, Thanks for your swift answer, i will do. I also looked into documentation of underlying https client, so i will probably figure it out. As a side note, i am also into making clocks for fun and i enjoy modern times and ability to laugh at saying that man with two clocks never knows time. :)

Cheers and thanks again. :)

On Sat, 24 Aug 2024 at 23:06, Mitch Markin @.***> wrote:

Hi Dragan

Thanks for your interest in my library. Sorry, I have never used ipapi.co with a paid subscription so I'm not sure how to add a key to the HTML request. There are lots of servers that find the location from an IP address, but I picked ipapi.co for my library because it doesn't require setting up an account and their free plan is more than enough for my applications.

I had a quick look through ipapi.co's documentation and couldn't find an example of an HTML request that includes a key. Their tech support is very good, though, so you could try contacting them directly to see if they can be of assistance.

Mitch

< https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Virus-free.www.avast.com < https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 1:06 PM Dragan Ceriman @.***> wrote:

Hi Mitch, Not so much an issue, more like a question. I am using paid option for ipapi.co, but if i just replace the url in c file things are not working. DO you have example with using the API key provided by ipapi?

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AHVRWOJJ23UTCQM5REGABS3ZTDRTXAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DIOBUGIYTSOI>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308537559, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWRRJY7FSHVZ46LIMYGBHLZTDYUVAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGUZTONJVHE . You are receiving this because you authored the thread.Message ID: @.***>

mmarkin commented 1 month ago

Hi Dragan

If you find out how to add your key I would be interested to know, so please keep me informed.

I have built lots of clocks. I have another post on GitHub that shows three of them if you want to have a look. The firmware I wrote for them is there too. mmarkin/EdgeLit_NTP_Clock https://github.com/mmarkin/EdgeLit_NTP_Clock

Yes, it looks bad if two or more digital clocks are within view and they don't show the same time!

Mitch

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free.www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 2:19 PM Dragan Ceriman @.***> wrote:

Mitch, Thanks for your swift answer, i will do. I also looked into documentation of underlying https client, so i will probably figure it out. As a side note, i am also into making clocks for fun and i enjoy modern times and ability to laugh at saying that man with two clocks never knows time. :)

Cheers and thanks again. :)

On Sat, 24 Aug 2024 at 23:06, Mitch Markin @.***> wrote:

Hi Dragan

Thanks for your interest in my library. Sorry, I have never used ipapi.co with a paid subscription so I'm not sure how to add a key to the HTML request. There are lots of servers that find the location from an IP address, but I picked ipapi.co for my library because it doesn't require setting up an account and their free plan is more than enough for my applications.

I had a quick look through ipapi.co's documentation and couldn't find an example of an HTML request that includes a key. Their tech support is very good, though, so you could try contacting them directly to see if they can be of assistance.

Mitch

<

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Virus-free.www.avast.com <

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 1:06 PM Dragan Ceriman @.***> wrote:

Hi Mitch, Not so much an issue, more like a question. I am using paid option for ipapi.co, but if i just replace the url in c file things are not working. DO you have example with using the API key provided by ipapi?

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AHVRWOJJ23UTCQM5REGABS3ZTDRTXAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DIOBUGIYTSOI>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308537559, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABWRRJY7FSHVZ46LIMYGBHLZTDYUVAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGUZTONJVHE>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308541796, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVRWONPBMH37QB3HIWB64DZTD2HZAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGU2DCNZZGY . You are receiving this because you commented.Message ID: @.***>

dceriman commented 1 month ago

Mitch, This looks amazing, i will have to build one of these, thanks for the tip. I figured out how to add key, but i presume it would be more elegant to add it properly via header file. So, line 78 in GeoIP.cpp client.println(F("GET /json/ HTTP/1.1")); API key provided by ipapi should go there like this client.println(F("GET /json/?key= HTTP/1.1")); and everything works like a charm.

BR, Dragan

On Sat, 24 Aug 2024 at 23:41, Mitch Markin @.***> wrote:

Hi Dragan

If you find out how to add your key I would be interested to know, so please keep me informed.

I have built lots of clocks. I have another post on GitHub that shows three of them if you want to have a look. The firmware I wrote for them is there too. mmarkin/EdgeLit_NTP_Clock https://github.com/mmarkin/EdgeLit_NTP_Clock

Yes, it looks bad if two or more digital clocks are within view and they don't show the same time!

Mitch

< https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Virus-free.www.avast.com < https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 2:19 PM Dragan Ceriman @.***> wrote:

Mitch, Thanks for your swift answer, i will do. I also looked into documentation of underlying https client, so i will probably figure it out. As a side note, i am also into making clocks for fun and i enjoy modern times and ability to laugh at saying that man with two clocks never knows time. :)

Cheers and thanks again. :)

On Sat, 24 Aug 2024 at 23:06, Mitch Markin @.***> wrote:

Hi Dragan

Thanks for your interest in my library. Sorry, I have never used ipapi.co with a paid subscription so I'm not sure how to add a key to the HTML request. There are lots of servers that find the location from an IP address, but I picked ipapi.co for my library because it doesn't require setting up an account and their free plan is more than enough for my applications.

I had a quick look through ipapi.co's documentation and couldn't find an example of an HTML request that includes a key. Their tech support is very good, though, so you could try contacting them directly to see if they can be of assistance.

Mitch

<

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Virus-free.www.avast.com <

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 1:06 PM Dragan Ceriman @.***> wrote:

Hi Mitch, Not so much an issue, more like a question. I am using paid option for ipapi.co, but if i just replace the url in c file things are not working. DO you have example with using the API key provided by ipapi?

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AHVRWOJJ23UTCQM5REGABS3ZTDRTXAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DIOBUGIYTSOI>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308537559, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABWRRJY7FSHVZ46LIMYGBHLZTDYUVAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGUZTONJVHE>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308541796, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AHVRWONPBMH37QB3HIWB64DZTD2HZAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGU2DCNZZGY>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308548033, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWRRJ6JH6PEJPBRSVO5O6TZTD4ZVAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGU2DQMBTGM . You are receiving this because you authored the thread.Message ID: @.***>

mmarkin commented 1 month ago

Hi Dragan,

Thanks for the information. Glad you managed to add your key to the library. I added a comment to the code that shows how to hardcode the key but it would be better to add the key as a parameter when the library's getGeoFromWifi() function is called—something to add to my to-do list.

Mitch Markin

On Sun, Aug 25, 2024 at 10:28 AM Dragan Ceriman @.***> wrote:

Mitch, This looks amazing, i will have to build one of these, thanks for the tip. I figured out how to add key, but i presume it would be more elegant to add it properly via header file. So, line 78 in GeoIP.cpp client.println(F("GET /json/ HTTP/1.1")); API key provided by ipapi should go there like this client.println(F("GET /json/?key= HTTP/1.1")); and everything works like a charm.

BR, Dragan

On Sat, 24 Aug 2024 at 23:41, Mitch Markin @.***> wrote:

Hi Dragan

If you find out how to add your key I would be interested to know, so please keep me informed.

I have built lots of clocks. I have another post on GitHub that shows three of them if you want to have a look. The firmware I wrote for them is there too. mmarkin/EdgeLit_NTP_Clock https://github.com/mmarkin/EdgeLit_NTP_Clock

Yes, it looks bad if two or more digital clocks are within view and they don't show the same time!

Mitch

<

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Virus-free.www.avast.com <

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 2:19 PM Dragan Ceriman @.***> wrote:

Mitch, Thanks for your swift answer, i will do. I also looked into documentation of underlying https client, so i will probably figure it out. As a side note, i am also into making clocks for fun and i enjoy modern times and ability to laugh at saying that man with two clocks never knows time. :)

Cheers and thanks again. :)

On Sat, 24 Aug 2024 at 23:06, Mitch Markin @.***> wrote:

Hi Dragan

Thanks for your interest in my library. Sorry, I have never used ipapi.co with a paid subscription so I'm not sure how to add a key to the HTML request. There are lots of servers that find the location from an IP address, but I picked ipapi.co for my library because it doesn't require setting up an account and their free plan is more than enough for my applications.

I had a quick look through ipapi.co's documentation and couldn't find an example of an HTML request that includes a key. Their tech support is very good, though, so you could try contacting them directly to see if they can be of assistance.

Mitch

<

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Virus-free.www.avast.com <

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 1:06 PM Dragan Ceriman @.***> wrote:

Hi Mitch, Not so much an issue, more like a question. I am using paid option for ipapi.co, but if i just replace the url in c file things are not working. DO you have example with using the API key provided by ipapi?

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AHVRWOJJ23UTCQM5REGABS3ZTDRTXAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DIOBUGIYTSOI>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308537559,

or

unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABWRRJY7FSHVZ46LIMYGBHLZTDYUVAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGUZTONJVHE>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308541796, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AHVRWONPBMH37QB3HIWB64DZTD2HZAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGU2DCNZZGY>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308548033, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABWRRJ6JH6PEJPBRSVO5O6TZTD4ZVAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGU2DQMBTGM>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308932959, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVRWOKBFATP6XNXPXQYSODZTIH4XAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYHEZTEOJVHE . You are receiving this because you commented.Message ID: @.***>

mmarkin commented 1 month ago

Hi Dragan;

I updated the GeoIP library to make adding an ipapi.co key easier. If you install version 1.3.1 the following getGeoFromWiFi function calls are supported so you can use any one of them.

loc = geoip.getGeoFromWiFi(); // no key, results not shown on serial monitor loc = geoip.getGeoFromWiFi(false); // no key, results not shown on serial monitor loc = geoip.getGeoFromWiFi(true); // no key, show results on on serial monitor loc = geoip.getGeoFromWiFi("Your API Key"); // use API key, results not shown on serial monitor loc = geoip.getGeoFromWiFi("Your API Key", false); // use API key, results not shown on serial monitor loc = geoip.getGeoFromWiFi("Your API Key", true); // use API key, show results on on serial monitor

I signed up for one month of ipapi.co's $12 plan so I could get a key for testing and everything works. This was an interesting coding exercise and it makes the library useable for more people. But as I said earlier, ipapi.co's free plan works for me and everyone that I have made clocks for, so I originally based the library on that and I won't be renewing my subscription when the month runs out.

GeoIP v1.3.1 is available on PlatformIO's library manager. It's also available on the mmarkin/GeoIP GitHub repository. The Arduino IDE should eventually pick up the new release so it should be available on their library manager, too.

Thanks again for your interest in my library and showing how I could make it more useful.

Cheers, Mitch Markin

On Tue, Aug 27, 2024 at 11:54 AM Mitch Markin @.***> wrote:

Hi Dragan,

Thanks for the information. Glad you managed to add your key to the library. I added a comment to the code that shows how to hardcode the key but it would be better to add the key as a parameter when the library's getGeoFromWifi() function is called—something to add to my to-do list.

Mitch Markin

On Sun, Aug 25, 2024 at 10:28 AM Dragan Ceriman @.***> wrote:

Mitch, This looks amazing, i will have to build one of these, thanks for the tip. I figured out how to add key, but i presume it would be more elegant to add it properly via header file. So, line 78 in GeoIP.cpp client.println(F("GET /json/ HTTP/1.1")); API key provided by ipapi should go there like this client.println(F("GET /json/?key= HTTP/1.1")); and everything works like a charm.

BR, Dragan

On Sat, 24 Aug 2024 at 23:41, Mitch Markin @.***> wrote:

Hi Dragan

If you find out how to add your key I would be interested to know, so please keep me informed.

I have built lots of clocks. I have another post on GitHub that shows three of them if you want to have a look. The firmware I wrote for them is there too. mmarkin/EdgeLit_NTP_Clock https://github.com/mmarkin/EdgeLit_NTP_Clock

Yes, it looks bad if two or more digital clocks are within view and they don't show the same time!

Mitch

<

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Virus-free.www.avast.com <

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 2:19 PM Dragan Ceriman @.***> wrote:

Mitch, Thanks for your swift answer, i will do. I also looked into documentation of underlying https client, so i will probably figure it out. As a side note, i am also into making clocks for fun and i enjoy modern times and ability to laugh at saying that man with two clocks never knows time. :)

Cheers and thanks again. :)

On Sat, 24 Aug 2024 at 23:06, Mitch Markin @.***> wrote:

Hi Dragan

Thanks for your interest in my library. Sorry, I have never used ipapi.co with a paid subscription so I'm not sure how to add a key to the HTML request. There are lots of servers that find the location from an IP address, but I picked ipapi.co for my library because it doesn't require setting up an account and their free plan is more than enough for my applications.

I had a quick look through ipapi.co's documentation and couldn't find an example of an HTML request that includes a key. Their tech support is very good, though, so you could try contacting them directly to see if they can be of assistance.

Mitch

<

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Virus-free.www.avast.com <

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 1:06 PM Dragan Ceriman @.***> wrote:

Hi Mitch, Not so much an issue, more like a question. I am using paid option for ipapi.co, but if i just replace the url in c file things are not working. DO you have example with using the API key provided by ipapi?

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AHVRWOJJ23UTCQM5REGABS3ZTDRTXAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DIOBUGIYTSOI>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308537559,

or

unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABWRRJY7FSHVZ46LIMYGBHLZTDYUVAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGUZTONJVHE>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308541796, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AHVRWONPBMH37QB3HIWB64DZTD2HZAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGU2DCNZZGY>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308548033, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABWRRJ6JH6PEJPBRSVO5O6TZTD4ZVAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGU2DQMBTGM>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308932959, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVRWOKBFATP6XNXPXQYSODZTIH4XAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYHEZTEOJVHE . You are receiving this because you commented.Message ID: @.***>

dceriman commented 1 month ago

Mitch, Great to hear from you. I will use new version, happy for constructive contribution. :)

Cheers, Dragan

On Thu, 29 Aug 2024 at 10:36, Mitch Markin @.***> wrote:

Hi Dragan;

I updated the GeoIP library to make adding an ipapi.co key easier. If you install version 1.3.1 the following getGeoFromWiFi function calls are supported so you can use any one of them.

loc = geoip.getGeoFromWiFi(); // no key, results not shown on serial monitorloc = geoip.getGeoFromWiFi(false); // no key, results not shown on serial monitorloc = geoip.getGeoFromWiFi(true); // no key, show results on on serial monitorloc = geoip.getGeoFromWiFi("Your API Key"); // use API key, results not shown on serial monitorloc = geoip.getGeoFromWiFi("Your API Key", false); // use API key, results not shown on serial monitorloc = geoip.getGeoFromWiFi("Your API Key", true); // use API key, show results on on serial monitor

I signed up for one month of ipapi.co's $12 plan so I could get a key for testing and everything works. This was an interesting coding exercise and it makes the library useable for more people. But as I said earlier, ipapi.co's free plan works for me and everyone that I have made clocks for, so I originally based the library on that and I won't be renewing my subscription when the month runs out.

GeoIP v1.3.1 is available on PlatformIO's library manager. It's also available on the mmarkin/GeoIP GitHub repository. The Arduino IDE should eventually pick up the new release so it should be available on their library manager, too.

Thanks again for your interest in my library and showing how I could make it more useful.

Cheers, Mitch Markin

On Tue, Aug 27, 2024 at 11:54 AM Mitch Markin @.***> wrote:

Hi Dragan,

Thanks for the information. Glad you managed to add your key to the library. I added a comment to the code that shows how to hardcode the key but it would be better to add the key as a parameter when the library's getGeoFromWifi() function is called—something to add to my to-do list.

Mitch Markin

On Sun, Aug 25, 2024 at 10:28 AM Dragan Ceriman @.***> wrote:

Mitch, This looks amazing, i will have to build one of these, thanks for the tip. I figured out how to add key, but i presume it would be more elegant to add it properly via header file. So, line 78 in GeoIP.cpp client.println(F("GET /json/ HTTP/1.1")); API key provided by ipapi should go there like this client.println(F("GET /json/?key= HTTP/1.1")); and everything works like a charm.

BR, Dragan

On Sat, 24 Aug 2024 at 23:41, Mitch Markin @.***> wrote:

Hi Dragan

If you find out how to add your key I would be interested to know, so please keep me informed.

I have built lots of clocks. I have another post on GitHub that shows three of them if you want to have a look. The firmware I wrote for them is there too. mmarkin/EdgeLit_NTP_Clock < https://github.com/mmarkin/EdgeLit_NTP_Clock>

Yes, it looks bad if two or more digital clocks are within view and they don't show the same time!

Mitch

<

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Virus-free.www.avast.com <

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 2:19 PM Dragan Ceriman @.***> wrote:

Mitch, Thanks for your swift answer, i will do. I also looked into documentation of underlying https client, so i will probably figure it out. As a side note, i am also into making clocks for fun and i enjoy modern times and ability to laugh at saying that man with two clocks never knows time. :)

Cheers and thanks again. :)

On Sat, 24 Aug 2024 at 23:06, Mitch Markin @.***> wrote:

Hi Dragan

Thanks for your interest in my library. Sorry, I have never used ipapi.co with a paid subscription so I'm not sure how to add a key to the HTML request. There are lots of servers that find the location from an IP address, but I picked ipapi.co for my library because it doesn't require setting up an account and their free plan is more than enough for my applications.

I had a quick look through ipapi.co's documentation and couldn't find an example of an HTML request that includes a key. Their tech support is very good, though, so you could try contacting them directly to see if they can be of assistance.

Mitch

<

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Virus-free.www.avast.com <

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Aug 24, 2024 at 1:06 PM Dragan Ceriman @.***> wrote:

Hi Mitch, Not so much an issue, more like a question. I am using paid option for ipapi.co, but if i just replace the url in c file things are not working. DO you have example with using the API key provided by ipapi?

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AHVRWOJJ23UTCQM5REGABS3ZTDRTXAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DIOBUGIYTSOI>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308537559>,

or

unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABWRRJY7FSHVZ46LIMYGBHLZTDYUVAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGUZTONJVHE>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308541796,

or

unsubscribe <

https://github.com/notifications/unsubscribe-auth/AHVRWONPBMH37QB3HIWB64DZTD2HZAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGU2DCNZZGY>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308548033, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABWRRJ6JH6PEJPBRSVO5O6TZTD4ZVAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGU2DQMBTGM>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2308932959, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AHVRWOKBFATP6XNXPXQYSODZTIH4XAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYHEZTEOJVHE>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/mmarkin/GeoIP/issues/1#issuecomment-2317027658, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWRRJ3U7ZDA2A4PGOR6G6TZT3MQDAVCNFSM6AAAAABNB3P6W6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJXGAZDONRVHA .

You are receiving this because you authored the thread.Message ID: @.***>