Skip to content

Commit f32b347

Browse files
Merge pull request #25 from IPGeolocation/sameer
Added Astronomy Examples
2 parents 2774fd7 + 86f260a commit f32b347

181 files changed

Lines changed: 4214 additions & 3137 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 368 additions & 108 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,18 @@
1-
# AsnLookupApi
1+
# ASNLookupAPI
22

33
All URIs are relative to *https://api.ipgeolocation.io/v2*
44

5-
| Method | HTTP request | Description |
6-
|------------- | ------------- | -------------|
7-
| [**asnGet**](AsnLookupApi.md#asnGet) | **GET** /asn | |
8-
9-
10-
<a id="asnGet"></a>
11-
# **asnGet**
12-
> ASNResponse asnGet().ip(ip).asn(asn).include(include).excludes(excludes).fields(fields).execute();
13-
14-
15-
16-
ASN API provides comprehensive details for an ASN including the as name, organization name, the country of registration, associated domain, and its type (ISP, host provider, or business). The API also shows the allocation date of provided ASN and if it is currently allocated or not. It also contains the routing information including peering, upstreams, and downstreams to help understand the relationship between different ASNs. Example Use Cases: - Looking up ASN information for an IP address (e.g., &#x60;GET /asn?ip&#x3D;8.8.8.8&#x60;) - Retrieving ASN information for a specific ASN number (e.g., &#x60;GET /asn?asn&#x3D;12345&#x60;) - Getting peering relationships for an ASN (e.g., &#x60;GET /asn?asn&#x3D;12345&amp;include&#x3D;peers&#x60;)
17-
18-
### Example
19-
20-
```java
21-
// Import classes:
22-
23-
import invoker.io.ipgeolocation.sdk.ApiClient;
24-
import invoker.io.ipgeolocation.sdk.ApiException;
25-
import invoker.io.ipgeolocation.sdk.Configuration;
26-
import io.ipgeolocation.sdk.api.AsnLookupAPI;
27-
import io.ipgeolocation.sdk.api.AsnLookupApi;
28-
import io.ipgeolocation.sdk.invoker.auth.ApiKeyAuth;
29-
30-
public class Example {
31-
public static void main(String[] args) {
32-
ApiClient defaultClient = Configuration.getDefaultApiClient();
33-
defaultClient.setBasePath("https://api.ipgeolocation.io/v2");
34-
35-
// Configure API key authorization: ApiKeyAuth
36-
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
37-
ApiKeyAuth.setApiKey("YOUR API KEY");
38-
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
39-
//ApiKeyAuth.setApiKeyPrefix("Token");
40-
41-
AsnLookupAPI apiInstance = new AsnLookupAPI(defaultClient);
42-
String ip = "8.8.8.8"; // String | query parameter 'ip'.
43-
Integer asn = 1; // Integer | query paramter 'asn'.
44-
String include = "peers"; // String | This parameter can have four options: a) peers b) downstreams c) upstreams d) routes e) whois_response. You may add any of them in comma-separated way. In order to get the ASN details with peering data, pass peers string in the include parameter like mentioned below.
45-
String excludes = "asn.date_allocated,asn.allocation_status"; // String | You can exclude fields from the response according to you requirement with the exception of ip field. For example, you want to remove date_allocated and allocation_status from api response, you can put the keys in excludes parameter like this.
46-
String fields = "asn.organization,asn.country,asn.downstreams"; // String | You can filter out only those fields which you want to see in the response by using the fields parameter. To retrieve only the AS organization, its country and downstreams in api response, you can put the keys in fields parameter like this. API will combine these fields with the default ASN response. Note: Parameters `peers, downstreams, upstreams, routes, whois_response` can be used in both `include` , and `fields`. If you use include and fields at the same time, fields parameter will be considered only.
47-
try {
48-
ASNResponse result = apiInstance.getAsnDetails()
49-
.ip(ip)
50-
.asn(asn)
51-
.include(include)
52-
.excludes(excludes)
53-
.fields(fields)
54-
.execute();
55-
System.out.println(result);
56-
} catch (ApiException e) {
57-
System.err.println("Exception when calling AsnLookupApi#asnGet");
58-
System.err.println("Status code: " + e.getCode());
59-
System.err.println("Reason: " + e.getResponseBody());
60-
System.err.println("Response headers: " + e.getResponseHeaders());
61-
e.printStackTrace();
62-
}
63-
}
64-
}
65-
```
5+
| Method | HTTP request | Description |
6+
|----------------------------------------------------| ------------- | -------------|
7+
| [**getAsnDetails**](ASNLookupAPI.md#getasndetails) | **GET** /asn | |
8+
9+
10+
# **getAsnDetails**
11+
> ASNResponse getAsnDetails().ip(ip).asn(asn).include(include).excludes(excludes).fields(fields).execute();
12+
13+
14+
15+
ASN API provides comprehensive details for an ASN including the as name, organization name, the country of registration, associated domain, and its type (ISP, host provider, or business). The API also shows the allocation date of provided ASN and if it is currently allocated or not. It also contains the routing information including peering, upstreams, and downstreams to help understand the relationship between different ASNs. Example Use Cases: - Looking up ASN information for an IP address (e.g., &#x60;GET /asn?ip&#x3D;8.8.8.8&#x60;) - Retrieving ASN information for a specific ASN number (e.g., &#x60;GET /asn?asn&#x3D;12345&#x60;) - Getting peering relationships for an ASN (e.g., &#x60;GET /asn?asn&#x3D;12345&amp;include&#x3D;peers&#x60;)
6616

6717
### Parameters
6818

@@ -80,7 +30,7 @@ public class Example {
8030

8131
### Authorization
8232

83-
[ApiKeyAuth](../README.md#ApiKeyAuth)
33+
[ApiKeyAuth](../README.md#authentication-setup)
8434

8535
### HTTP request headers
8636

docs/ASNResponseXMLAsn.md

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

docs/AbuseContactAPI.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# AbuseContactAPI
2+
3+
All URIs are relative to *https://api.ipgeolocation.io/v2*
4+
5+
| Method | HTTP request | Description |
6+
|-------------------------------------------------------------------| ------------- | -------------|
7+
| [**getAbuseContactInfo**](AbuseContactAPI.md#getabusecontactinfo) | **GET** /abuse | |
8+
9+
10+
11+
# **getAbuseContactInfo**
12+
> AbuseResponse getAbuseContactInfo().ip(ip).excludes(excludes).fields(fields).execute();
13+
14+
15+
16+
The Abuse Contact API provides essential contact information to report abusive activity associated with IP addresses. By querying an IP address (IPv4 or IPv6), users receive detailed abuse contact data, including the responsible organization, abuse handling role, contact emails, phone numbers, and registered address. This enables users to swiftly take action to report and mitigate threats such as spam, DDoS attacks, and phishing. In addition to abuse-specific contacts, the API also includes registration metadata like the registered country and abuse handle. This empowers cybersecurity teams, hosting providers, and compliance entities to take appropriate legal or administrative action.
17+
18+
### Parameters
19+
20+
| Name | Type | Description | Notes |
21+
|------------- | ------------- | ------------- | -------------|
22+
| **ip** | **String**| query parameter &#39;ip&#39;. | [optional] |
23+
| **excludes** | **String**| You can exclude specific fields from the API response (except the ip field) by listing them in the excludes parameter as a comma-separated list. For example, you want to remove emails and handle from api response, you can put the keys in excludes parameter like this. | [optional] |
24+
| **fields** | **String**| You can customize the API response by using the fields parameter to include only the specific data you need. For example, to retrieve only the role and emails, specify these keys in the fields parameter as shown below. | [optional] |
25+
26+
### Return type
27+
28+
[**AbuseResponse**](AbuseResponse.md)
29+
30+
### Authorization
31+
32+
[ApiKeyAuth](../README.md#authentication-setup)
33+
34+
### HTTP request headers
35+
36+
- **Content-Type**: Not defined
37+
- **Accept**: application/json, application/xml
38+
39+
### HTTP response details
40+
| Status code | Description | Response headers |
41+
|-------------|-------------|------------------|
42+
| **200** | Successful response | - |
43+
| **400** | Bad Request – Possible reasons include: - If the provided IPv4, IPv6 address, or ASN is invalid. - If special character(s) ( ) [ ] { } | ^ &#x60; is passed in the API URL either as paramter or its value. Specially in case of API key. | - |
44+
| **401** | Unauthorized – Possible reasons include: - Missing or invalid API key - Account unverified, locked, or disabled - Accessing API with an unauthorized key - Subscription expired or downgraded - If your account has been disabled or locked to use by the admin due to abuse or illegal activity. - When the request to IP Abuse Contact API is made using API key for a database subscription - When the request to IP Abuse Contact API is made on the &#39;paused&#39; subscription. - If you’re making API requests after your subscription trial has been expired. - If your active until date has passed and you need to upgrade your account. | - |
45+
| **404** | Not Found – Possible reasons include: - If the IPv4, IPv6, or ASN name does not exist in our database. - If the IPv4, IPv6, or ASN is passed as a path variable, instead of url parameter as ip&#x3D;. - If the wrong endpoint is called, that does not exist in our API. | - |
46+
| **405** | Method Not Allowed – Only GET is allowed for &#x60;/abuse&#x60; endpoint | - |
47+
| **429** | Too Many Requests – Possible reasons include: - If the API usage limit has reached for the free subscriptions, or paid subscriptions with the status &#39;past due&#39;, &#39;deleted&#39; or &#39;trial expired&#39;. - If the surcharge API usage limit has reached against the subscribed plan. | - |
48+
| **499** | Client Closed Request – Client terminated connection before completion | - |
49+
| **500** | Internal Server Error – Something went wrong on our end | - |
50+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22

3-
# ASNResponseXML
3+
# AbuseResponse
44

55

66
## Properties
77

88
| Name | Type | Description | Notes |
99
|------------ | ------------- | ------------- | -------------|
1010
|**ip** | **String** | | [optional] |
11-
|**asn** | [**ASNResponseXMLAsn**](ASNResponseXMLAsn.md) | | [optional] |
11+
|**abuse** | [**Abuse**](Abuse.md) | | [optional] |
1212

1313

1414

docs/Astronomy.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,29 @@
77

88
| Name | Type | Description | Notes |
99
|------------ | ------------- | ------------- | -------------|
10-
|**date** | **LocalDate** | | [optional] |
10+
|**date** | **String** | | [optional] |
1111
|**currentTime** | **String** | | [optional] |
12+
|**midNight** | **String** | | [optional] |
13+
|**nightEnd** | **String** | | [optional] |
14+
|**morning** | [**AstronomyMorning**](AstronomyMorning.md) | | [optional] |
1215
|**sunrise** | **String** | | [optional] |
1316
|**sunset** | **String** | | [optional] |
17+
|**evening** | [**AstronomyEvening**](AstronomyEvening.md) | | [optional] |
18+
|**nightBegin** | **String** | | [optional] |
1419
|**sunStatus** | **String** | | [optional] |
1520
|**solarNoon** | **String** | | [optional] |
1621
|**dayLength** | **String** | | [optional] |
1722
|**sunAltitude** | **BigDecimal** | | [optional] |
1823
|**sunDistance** | **BigDecimal** | | [optional] |
1924
|**sunAzimuth** | **BigDecimal** | | [optional] |
25+
|**moonPhase** | **String** | | [optional] |
2026
|**moonrise** | **String** | | [optional] |
2127
|**moonset** | **String** | | [optional] |
2228
|**moonStatus** | **String** | | [optional] |
2329
|**moonAltitude** | **BigDecimal** | | [optional] |
2430
|**moonDistance** | **BigDecimal** | | [optional] |
2531
|**moonAzimuth** | **BigDecimal** | | [optional] |
2632
|**moonParallacticAngle** | **BigDecimal** | | [optional] |
27-
|**moonPhase** | **String** | | [optional] |
2833
|**moonIlluminationPercentage** | **String** | | [optional] |
2934
|**moonAngle** | **BigDecimal** | | [optional] |
3035

docs/AstronomyAPI.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# AstronomyAPI
2+
3+
All URIs are relative to *https://api.ipgeolocation.io/v2*
4+
5+
| Method | HTTP request | Description |
6+
|--------------------------------------------------| ------------- | -------------|
7+
| [**getAstronomy**](AstronomyAPI.md#getAstronomy) | **GET** /astronomy | |
8+
9+
10+
11+
# **getAstronomy**
12+
> AstronomyResponse getAstronomy().ip(ip).location(location).lat(lat)._long(_long).date(date).elevation(elevation).output(output).lang(lang).execute();
13+
14+
15+
16+
The Astronomy API provides the location-based rise and set times for the Sun and Moon along with the current position, distance from earth, and azimuth of the Sun and the Moon for a specific date at the queried time.
17+
18+
### Parameters
19+
20+
| Name | Type | Description | Notes |
21+
|------------- | ------------- | ------------- | -------------|
22+
| **ip** | **String**| query paramter &#39;ip&#39;. If not provided, will be your network IP | [optional] |
23+
| **location** | **String**| query paramter &#39;location&#39;. If not provided, will be your ip location | [optional] |
24+
| **lat** | **String**| query paramter &#39;lat&#39;. | [optional] |
25+
| **_long** | **String**| query paramter &#39;long&#39;. | [optional] |
26+
| **date** | **String**| The date (YYYY-MM-DD) to lookup for. default will be the current date | [optional] |
27+
| **elevation** | **Double**| query parameter &#39;elevation&#39; | [optional] |
28+
| **output** | **String**| Desired output format. | [optional] |
29+
| **lang** | **String**| By default, the API responds in English. You can change the response language by passing the language code as a query parameter &#x60;lang&#x60;. Multi language feature is available only for &#x60;paid users&#x60;. | [optional] [enum: en, de, ru, ja, fr, cn, es, cs, it, ko, fa, pt] |
30+
31+
### Return type
32+
33+
[**AstronomyResponse**](AstronomyResponse.md)
34+
35+
### Authorization
36+
37+
[ApiKeyAuth](../README.md#authentication-setup)
38+
39+
### HTTP request headers
40+
41+
- **Content-Type**: Not defined
42+
- **Accept**: application/json, application/xml
43+
44+
### HTTP response details
45+
| Status code | Description | Response headers |
46+
|-------------|-------------|------------------|
47+
| **200** | Successful response | - |
48+
| **400** | Bad Request – Possible reasons include: - Invalid or not found location/address - Special characters in API key or value - Invalid date format (expected: yyyy-MM-dd) - IP not found in the database | - |
49+
| **401** | Unauthorized – Possible reasons include: - Missing or invalid API key - Account unverified, locked, or disabled - Accessing API with an unauthorized key - Subscription expired or downgraded | - |
50+
| **405** | Method Not Allowed – Only GET is allowed for &#x60;/astronomy&#x60; endpoint | - |
51+
| **429** | Too Many Requests – API usage limits exceeded for current plan | - |
52+
| **499** | Client Closed Request – Client terminated connection before completion | - |
53+
| **500** | Internal Server Error – Something went wrong on our end | - |
54+

0 commit comments

Comments
 (0)