Skip to content

Commit 8f53806

Browse files
Merge pull request #29 from ipdata/claude/update-ipdata-api-5MQTy
Claude/update ipdata api 5 mq ty
2 parents 4ddfd34 + 10f4f83 commit 8f53806

63 files changed

Lines changed: 314 additions & 845 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Describe the big picture of your changes here to communicate to the maintainers
44

55
## Types of changes
66

7-
What types of changes does your code introduce to IpData?
7+
What types of changes does your code introduce to IPData?
88
_Put an `x` in the boxes that apply_
99

1010
- [ ] Bugfix (non-breaking change which fixes an issue)
@@ -15,7 +15,7 @@ _Put an `x` in the boxes that apply_
1515

1616
_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
1717

18-
- [ ] I have read the [CONTRIBUTING](https://github.com/alexkhil/IpData/blob/master/.github/CONTRIBUTING.md) doc
18+
- [ ] I have read the [CONTRIBUTING](https://github.com/alexkhil/IPData/blob/master/.github/CONTRIBUTING.md) doc
1919
- [ ] Lint and unit tests pass locally with my changes
2020
- [ ] I have added tests that prove my fix is effective or that my feature works
2121
- [ ] I have added necessary documentation (if appropriate)

.github/README.md

Lines changed: 63 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

2-
# ipdata
3-
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/alexkhil/IpData/blob/master/LICENSE) [![IpData](https://img.shields.io/nuget/v/IpData.svg)](https://www.nuget.org/packages/IpData/) [![Build Status](https://dev.azure.com/alexkhildev/IpData/_apis/build/status/outer-loop?branchName=master)](https://dev.azure.com/alexkhildev/IpData/_build/latest?definitionId=4?branchName=master) [![Coverage Status](https://img.shields.io/azure-devops/coverage/alexkhildev/ipdata/4/master)](https://img.shields.io/azure-devops/coverage/alexkhildev/ipdata/4/master)
2+
# ipdata
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/alexkhil/IPData/blob/master/LICENSE) [![IPData](https://img.shields.io/nuget/v/IPData.svg)](https://www.nuget.org/packages/IPData/)
4+
5+
> **v3.0.0 Breaking Changes** — All public types have been renamed to follow .NET naming conventions for two-letter acronyms. See the [Migration Guide](#migrating-from-v2-to-v3) for details.
46
57
[ipdata.co](https://ipdata.co/) is a fast, reliable and clean service that allows you to look up the location of an IP Address and other data.
68

@@ -17,6 +19,7 @@
1719
- [Currency](#currency)
1820
- [Threat](#threat)
1921
- [EU Endpoint](#eu-endpoint)
22+
- [Migrating from v2 to v3](#migrating-from-v2-to-v3)
2023
- [Contributing](#contributing)
2124
- [Versioning](#versioning)
2225
- [License](#license)
@@ -26,13 +29,13 @@
2629
NuGet package install using package manager:
2730

2831
```bash
29-
Install-Package IpData -Version 2.0.1
32+
Install-Package IPData -Version 3.0.0
3033
```
3134

3235
NuGet package install using .NET CLI:
3336

3437
```bash
35-
dotnet add package IpData --version 2.0.1
38+
dotnet add package IPData --version 3.0.0
3639
```
3740

3841
## Lookup
@@ -42,11 +45,11 @@ All usage examples you can find on `samples` folder.
4245
### Basic
4346

4447
```csharp
45-
var client = new IpDataClient("API_KEY");
48+
var client = new IPDataClient("API_KEY");
4649

4750
// Get IP data from my IP
48-
var myIpInfo = await client.Lookup();
49-
Console.WriteLine($"Country name for {myIpInfo.Ip} is {myIpInfo.CountryName}");
51+
var myIp = await client.Lookup();
52+
Console.WriteLine($"Country name for {myIp.Ip} is {myIp.CountryName}");
5053

5154
// Get IP data from IP
5255
var ipInfo = await client.Lookup("8.8.8.8");
@@ -67,7 +70,7 @@ From ipdata.co docs:
6770
> Note that bulk lookups are only available to paid users and are currently limited to a 100 at a time. Reach out to support if you need to lookup larger batches.
6871
6972
```csharp
70-
var client = new IpDataClient("API_KEY");
73+
var client = new IPDataClient("API_KEY");
7174

7275
var ipInfoList = await client.Lookup(new string[] { "1.1.1.1", "2.2.2.2", "3.3.3.3" });
7376
foreach (var ipInfo in ipInfoList)
@@ -79,7 +82,7 @@ foreach (var ipInfo in ipInfoList)
7982
### Carrier
8083

8184
```csharp
82-
var client = new IpDataClient("API_KEY");
85+
var client = new IPDataClient("API_KEY");
8386

8487
var carrierInfo = await client.Carrier("69.78.70.144");
8588
Console.WriteLine($"Carrier name: {carrierInfo.Name}");
@@ -88,7 +91,7 @@ Console.WriteLine($"Carrier name: {carrierInfo.Name}");
8891
### Company
8992

9093
```csharp
91-
var client = new IpDataClient("API_KEY");
94+
var client = new IPDataClient("API_KEY");
9295

9396
var companyInfo = await client.Company("69.78.70.144");
9497
Console.WriteLine($"Company name: {companyInfo.Name}");
@@ -97,7 +100,7 @@ Console.WriteLine($"Company name: {companyInfo.Name}");
97100
### ASN
98101

99102
```csharp
100-
var client = new IpDataClient("API_KEY");
103+
var client = new IPDataClient("API_KEY");
101104

102105
var asnInfo = await client.Asn("69.78.70.144");
103106
Console.WriteLine($"ASN name: {asnInfo.Name}");
@@ -106,7 +109,7 @@ Console.WriteLine($"ASN name: {asnInfo.Name}");
106109
### Timezone
107110

108111
```csharp
109-
var client = new IpDataClient("API_KEY");
112+
var client = new IPDataClient("API_KEY");
110113

111114
var timezoneInfo = await client.TimeZone("69.78.70.144");
112115
Console.WriteLine($"TimeZone name: {timezoneInfo.Name}");
@@ -115,7 +118,7 @@ Console.WriteLine($"TimeZone name: {timezoneInfo.Name}");
115118
### Currency
116119

117120
```csharp
118-
var client = new IpDataClient("API_KEY");
121+
var client = new IPDataClient("API_KEY");
119122

120123
var currencyInfo = await client.Currency("69.78.70.144");
121124
Console.WriteLine($"Currency name: {currencyInfo.Name}");
@@ -124,7 +127,7 @@ Console.WriteLine($"Currency name: {currencyInfo.Name}");
124127
### Threat
125128

126129
```csharp
127-
var client = new IpDataClient("API_KEY");
130+
var client = new IPDataClient("API_KEY");
128131

129132
var threatInfo = await client.Threat("69.78.70.144");
130133
Console.WriteLine($"Threat is Tor: {threatInfo.IsTor}");
@@ -135,11 +138,52 @@ Console.WriteLine($"Threat is Tor: {threatInfo.IsTor}");
135138
To ensure your data stays in the EU, use the EU endpoint by passing a custom base URL:
136139

137140
```csharp
138-
var client = new IpDataClient("API_KEY", new Uri("https://eu-api.ipdata.co"));
141+
var client = new IPDataClient("API_KEY", new Uri("https://eu-api.ipdata.co"));
139142

140143
var ipInfo = await client.Lookup("8.8.8.8");
141144
```
142145

146+
## Migrating from v2 to v3
147+
148+
v3.0.0 renames all public types to follow [.NET naming conventions](https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions) for two-letter acronyms. It also adds EU endpoint support and a `Company` lookup.
149+
150+
### Renamed types
151+
152+
| v2 | v3 |
153+
|---|---|
154+
| `IpDataClient` | `IPDataClient` |
155+
| `IIpDataClient` | `IIPDataClient` |
156+
| `IpInfo` | `IPLookupResult` |
157+
158+
### Namespace change
159+
160+
```diff
161+
- using IpData;
162+
- using IpData.Models;
163+
+ using IPData;
164+
+ using IPData.Models;
165+
```
166+
167+
### NuGet package
168+
169+
The package ID has changed from `IpData` to `IPData`:
170+
171+
```bash
172+
dotnet remove package IpData
173+
dotnet add package IPData --version 3.0.0
174+
```
175+
176+
### New features in v3
177+
178+
- **EU endpoint** — Pass a custom base URL to route requests through EU servers:
179+
```csharp
180+
var client = new IPDataClient("API_KEY", new Uri("https://eu-api.ipdata.co"));
181+
```
182+
- **Company lookup** — Fetch company info for an IP:
183+
```csharp
184+
var companyInfo = await client.Company("8.8.8.8");
185+
```
186+
143187
## Contributing
144188

145189
Please read [CONTRIBUTING.md][CONTRIBUTING] for details on our code of conduct, and the process for submitting pull requests to us.
@@ -153,8 +197,8 @@ We use [SemVer] for versioning. For the versions available, see the tags on this
153197
This project is licensed under the MIT License - see the [LICENSE.md][LICENSE] file for details
154198

155199

156-
[AzureStatus]: https://dev.azure.com/alexkhildev/IpData/_apis/build/status/gated?branchName=master
157-
[IpDataLogo]: https://image.ibb.co/iDQdUS/ipdatalogo.png
200+
[AzureStatus]: https://dev.azure.com/alexkhildev/IPData/_apis/build/status/gated?branchName=master
201+
[IPDataLogo]: https://image.ibb.co/iDQdUS/ipdatalogo.png
158202
[SemVer]: http://semver.org/
159-
[CONTRIBUTING]: https://github.com/alexkhil/IpData/blob/master/.github/CONTRIBUTING.md
160-
[LICENSE]: https://github.com/alexkhil/IpData/blob/master/LICENSE
203+
[CONTRIBUTING]: https://github.com/alexkhil/IPData/blob/master/.github/CONTRIBUTING.md
204+
[LICENSE]: https://github.com/alexkhil/IPData/blob/master/LICENSE

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: '8.0.x'
20+
21+
- name: Restore dependencies
22+
run: dotnet restore
23+
24+
- name: Build
25+
run: dotnet build --configuration Release --no-restore
26+
27+
- name: Test
28+
run: dotnet test --configuration Release --no-build --verbosity normal

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup .NET
15+
uses: actions/setup-dotnet@v4
16+
with:
17+
dotnet-version: '8.0.x'
18+
19+
- name: Restore dependencies
20+
run: dotnet restore
21+
22+
- name: Build
23+
run: dotnet build --configuration Release --no-restore
24+
25+
- name: Test
26+
run: dotnet test --configuration Release --no-build --verbosity normal
27+
28+
- name: Pack
29+
run: dotnet pack src/IPData/IPData.csproj --configuration Release --no-build --output ./nupkg
30+
31+
- name: Publish to NuGet
32+
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

IpData.sln renamed to IPData.sln

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.28902.138
@@ -9,43 +9,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E961
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0FD24B4A-2B2B-4DCC-88F4-F13398F0CB18}"
1111
EndProject
12-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{CFFA9471-EC37-451E-BA20-3DA090F0A683}"
13-
EndProject
14-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tasks", "Tasks", "{C0FF3B0D-BE20-4F54-ACD3-D8B45CAD5B57}"
15-
ProjectSection(SolutionItems) = preProject
16-
build\cake\Tasks\build.cake = build\cake\Tasks\build.cake
17-
build\cake\Tasks\clean.cake = build\cake\Tasks\clean.cake
18-
build\cake\Tasks\create-nuget-package.cake = build\cake\Tasks\create-nuget-package.cake
19-
build\cake\Tasks\default.cake = build\cake\Tasks\default.cake
20-
build\cake\Tasks\publish-nuget-package.cake = build\cake\Tasks\publish-nuget-package.cake
21-
build\cake\Tasks\restore-nuget-packages.cake = build\cake\Tasks\restore-nuget-packages.cake
22-
build\cake\Tasks\run-unit-tests.cake = build\cake\Tasks\run-unit-tests.cake
23-
EndProjectSection
24-
EndProject
25-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cake", "cake", "{5CF04261-17B9-44F2-AD3F-C19C92796442}"
26-
ProjectSection(SolutionItems) = preProject
27-
build\cake\build.cake = build\cake\build.cake
28-
build\cake\build.ps1 = build\cake\build.ps1
29-
build\cake\build.sh = build\cake\build.sh
30-
build\cake\cake.config = build\cake\cake.config
31-
EndProjectSection
32-
EndProject
3312
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Unit", "Unit", "{6F037AC1-A8B5-4D89-B33A-BCDDB78553A6}"
3413
EndProject
35-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IpData", "src\IpData\IpData.csproj", "{7EE175C0-1309-4AA7-BC80-2F01A3855D9A}"
36-
EndProject
37-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IpData.Tests", "test\Unit\IpData.Tests\IpData.Tests.csproj", "{65B7BCF3-82C8-480E-ADC3-B45DD67BD565}"
38-
EndProject
39-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{049BFCD0-AD71-4357-91CF-62CC03D8FB39}"
40-
ProjectSection(SolutionItems) = preProject
41-
build\cake\tools\packages.config = build\cake\tools\packages.config
42-
EndProjectSection
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IPData", "src\IPData\IPData.csproj", "{7EE175C0-1309-4AA7-BC80-2F01A3855D9A}"
4315
EndProject
44-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "azure-devops", "azure-devops", "{3A111F6A-56C3-4952-B45F-5CDA714D059F}"
45-
ProjectSection(SolutionItems) = preProject
46-
build\azure-devops\gated.yaml = build\azure-devops\gated.yaml
47-
build\azure-devops\outer-loop.yaml = build\azure-devops\outer-loop.yaml
48-
EndProjectSection
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IPData.Tests", "test\Unit\IPData.Tests\IPData.Tests.csproj", "{65B7BCF3-82C8-480E-ADC3-B45DD67BD565}"
4917
EndProject
5018
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{3B7FCB46-B3B6-41EF-9495-3FA4D027E3FC}"
5119
ProjectSection(SolutionItems) = preProject
@@ -61,19 +29,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEM
6129
.github\ISSUE_TEMPLATE\Feature_request.md = .github\ISSUE_TEMPLATE\Feature_request.md
6230
EndProjectSection
6331
EndProject
64-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{4C55C81D-E924-4BA9-9A6C-92B74EC4F7AE}"
65-
ProjectSection(SolutionItems) = preProject
66-
build\cake\Utils\paths.cake = build\cake\Utils\paths.cake
67-
EndProjectSection
68-
EndProject
6932
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{70F5FBDA-9DAA-4675-938E-EC6E450852CE}"
7033
ProjectSection(SolutionItems) = preProject
7134
.editorconfig = .editorconfig
7235
.gitignore = .gitignore
7336
LICENSE = LICENSE
7437
EndProjectSection
7538
EndProject
76-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IpData.Lookup", "samples\IpData.Lookup\IpData.Lookup.csproj", "{3546F4B5-7D43-4332-914A-6A657D95CEB1}"
39+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IPData.Lookup", "samples\IPData.Lookup\IPData.Lookup.csproj", "{3546F4B5-7D43-4332-914A-6A657D95CEB1}"
7740
EndProject
7841
Global
7942
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -98,15 +61,10 @@ Global
9861
HideSolutionNode = FALSE
9962
EndGlobalSection
10063
GlobalSection(NestedProjects) = preSolution
101-
{C0FF3B0D-BE20-4F54-ACD3-D8B45CAD5B57} = {5CF04261-17B9-44F2-AD3F-C19C92796442}
102-
{5CF04261-17B9-44F2-AD3F-C19C92796442} = {CFFA9471-EC37-451E-BA20-3DA090F0A683}
103-
{6F037AC1-A8B5-4D89-B33A-BCDDB78553A6} = {0FD24B4A-2B2B-4DCC-88F4-F13398F0CB18}
10464
{7EE175C0-1309-4AA7-BC80-2F01A3855D9A} = {6EF86008-5993-4F7A-8B4B-F30A85BC6EE8}
10565
{65B7BCF3-82C8-480E-ADC3-B45DD67BD565} = {6F037AC1-A8B5-4D89-B33A-BCDDB78553A6}
106-
{049BFCD0-AD71-4357-91CF-62CC03D8FB39} = {5CF04261-17B9-44F2-AD3F-C19C92796442}
107-
{3A111F6A-56C3-4952-B45F-5CDA714D059F} = {CFFA9471-EC37-451E-BA20-3DA090F0A683}
66+
{6F037AC1-A8B5-4D89-B33A-BCDDB78553A6} = {0FD24B4A-2B2B-4DCC-88F4-F13398F0CB18}
10867
{C92F6AF1-C354-4965-AD3C-938BC870F853} = {3B7FCB46-B3B6-41EF-9495-3FA4D027E3FC}
109-
{4C55C81D-E924-4BA9-9A6C-92B74EC4F7AE} = {5CF04261-17B9-44F2-AD3F-C19C92796442}
11068
{3546F4B5-7D43-4332-914A-6A657D95CEB1} = {E961F502-9430-4E81-95AE-C202E0AE643F}
11169
EndGlobalSection
11270
GlobalSection(ExtensibilityGlobals) = postSolution

build/azure-devops/gated.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

build/azure-devops/outer-loop.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)