Skip to content

Commit 38adcea

Browse files
authored
minor changes (#10)
1 parent 7b16d9f commit 38adcea

File tree

1 file changed

+115
-114
lines changed

1 file changed

+115
-114
lines changed

README.md

Lines changed: 115 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,121 @@ Sample Response:
10461046
}
10471047
}
10481048
```
1049+
1050+
## Abuse Contact API Examples
1051+
This section demonstrates how to use the `getAbuseContactInfo()` method of the SDK. This API helps security teams, hosting providers, and compliance professionals quickly identify the correct abuse reporting contacts for any IPv4 or IPv6 address.
1052+
1053+
You can retrieve data like the responsible organization, role, contact emails, phone numbers, and address to take appropriate mitigation action against abusive or malicious activity.
1054+
1055+
> [!NOTE]
1056+
> Abuse Contact API is only available in the **Advanced Plan**.
1057+
1058+
Refer to the official [Abuse Contact API documentation](https://ipgeolocation.io/ip-abuse-contact-api.html#documentation-overview) for details on all available fields.
1059+
1060+
### Lookup Abuse Contact by IP
1061+
```typescript
1062+
import {
1063+
Configuration,
1064+
AbuseContactApi
1065+
} from 'ip-geolocation-api-sdk-typescript';
1066+
const configuration = new Configuration({ apiKey: 'YOUR_API_KEY' });
1067+
const api = new AbuseContactApi(configuration);
1068+
1069+
async function getAbuseContact() {
1070+
try {
1071+
const {data} = await api.getAbuseContactInfo({
1072+
ip: '1.0.0.0'
1073+
});
1074+
console.log(data);
1075+
} catch (error) {
1076+
console.error('Error fetching location:', error);
1077+
}
1078+
}
1079+
getAbuseContact();
1080+
```
1081+
Sample Response:
1082+
```json
1083+
{
1084+
"ip": "1.0.0.0",
1085+
"abuse": {
1086+
"route": "1.0.0.0/24",
1087+
"country": "AU",
1088+
"handle": "IRT-APNICRANDNET-AU",
1089+
"name": "IRT-APNICRANDNET-AU",
1090+
"organization": "",
1091+
"role": "abuse",
1092+
"kind": "group",
1093+
"address": "PO Box 3646\nSouth Brisbane, QLD 4101\nAustralia",
1094+
"emails": [
1095+
"helpdesk@apnic.net"
1096+
],
1097+
"phone_numbers": [
1098+
"+61 7 3858 3100"
1099+
]
1100+
}
1101+
}
1102+
```
1103+
### Lookup Abuse Contact with Specific Fields
1104+
```typescript
1105+
async function getAbuseContact() {
1106+
try {
1107+
const {data} = await api.getAbuseContactInfo({
1108+
ip: '1.2.3.4',
1109+
fields: 'abuse.role,abuse.emails'
1110+
});
1111+
console.log(data);
1112+
} catch (error) {
1113+
console.error('Error fetching location:', error);
1114+
}
1115+
}
1116+
getAbuseContact();
1117+
```
1118+
Sample Response:
1119+
```json
1120+
{
1121+
"ip": "1.2.3.4",
1122+
"abuse": {
1123+
"role": "abuse",
1124+
"emails": [
1125+
"helpdesk@apnic.net"
1126+
]
1127+
}
1128+
}
1129+
```
1130+
### Lookup Abuse Contact while Excluding Fields
1131+
```typescript
1132+
async function getAbuseContact() {
1133+
try {
1134+
const {data} = await api.getAbuseContactInfo({
1135+
ip: '9.9.9.9',
1136+
excludes: 'abuse.handle,abuse.emails'
1137+
});
1138+
console.log(data);
1139+
} catch (error) {
1140+
console.error('Error fetching location:', error);
1141+
}
1142+
}
1143+
getAbuseContact();
1144+
```
1145+
Sample Response:
1146+
```json
1147+
{
1148+
"ip": "9.9.9.9",
1149+
"abuse": {
1150+
"route": "9.9.9.0/24",
1151+
"country": "",
1152+
"name": "Quad9 Abuse",
1153+
"organization": "Quad9 Abuse",
1154+
"role": "abuse",
1155+
"kind": "group",
1156+
"address": "1442 A Walnut Street Ste 501\nBerkeley\nCA\n94709\nUnited States",
1157+
"phone_numbers": [
1158+
"+1-415-831-3129"
1159+
]
1160+
}
1161+
}
1162+
```
1163+
10491164
## Timezone API Examples
10501165
This section provides usage examples of the `getTimezoneInfo()` method from the typescript SDK, showcasing how to fetch timezone and time-related data using different query types — IP address, latitude/longitude, timezone ID, IATA code, ICAO code, or UN/LOCODE.
10511166

@@ -2009,120 +2124,6 @@ Sample Response:
20092124
}
20102125
```
20112126

2012-
## Abuse Contact API Examples
2013-
This section demonstrates how to use the `getAbuseContactInfo()` method of the SDK. This API helps security teams, hosting providers, and compliance professionals quickly identify the correct abuse reporting contacts for any IPv4 or IPv6 address.
2014-
2015-
You can retrieve data like the responsible organization, role, contact emails, phone numbers, and address to take appropriate mitigation action against abusive or malicious activity.
2016-
2017-
> [!NOTE]
2018-
> Abuse Contact API is only available in the **Advanced Plan**.
2019-
2020-
Refer to the official [Abuse Contact API documentation](https://ipgeolocation.io/ip-abuse-contact-api.html#documentation-overview) for details on all available fields.
2021-
2022-
### Lookup Abuse Contact by IP
2023-
```typescript
2024-
import {
2025-
Configuration,
2026-
AbuseContactApi
2027-
} from 'ip-geolocation-api-sdk-typescript';
2028-
const configuration = new Configuration({ apiKey: 'YOUR_API_KEY' });
2029-
const api = new AbuseContactApi(configuration);
2030-
2031-
async function getAbuseContact() {
2032-
try {
2033-
const {data} = await api.getAbuseContactInfo({
2034-
ip: '1.0.0.0'
2035-
});
2036-
console.log(data);
2037-
} catch (error) {
2038-
console.error('Error fetching location:', error);
2039-
}
2040-
}
2041-
getAbuseContact();
2042-
```
2043-
Sample Response:
2044-
```json
2045-
{
2046-
"ip": "1.0.0.0",
2047-
"abuse": {
2048-
"route": "1.0.0.0/24",
2049-
"country": "AU",
2050-
"handle": "IRT-APNICRANDNET-AU",
2051-
"name": "IRT-APNICRANDNET-AU",
2052-
"organization": "",
2053-
"role": "abuse",
2054-
"kind": "group",
2055-
"address": "PO Box 3646\nSouth Brisbane, QLD 4101\nAustralia",
2056-
"emails": [
2057-
"helpdesk@apnic.net"
2058-
],
2059-
"phone_numbers": [
2060-
"+61 7 3858 3100"
2061-
]
2062-
}
2063-
}
2064-
```
2065-
### Lookup Abuse Contact with Specific Fields
2066-
```typescript
2067-
async function getAbuseContact() {
2068-
try {
2069-
const {data} = await api.getAbuseContactInfo({
2070-
ip: '1.2.3.4',
2071-
fields: 'abuse.role,abuse.emails'
2072-
});
2073-
console.log(data);
2074-
} catch (error) {
2075-
console.error('Error fetching location:', error);
2076-
}
2077-
}
2078-
getAbuseContact();
2079-
```
2080-
Sample Response:
2081-
```json
2082-
{
2083-
"ip": "1.2.3.4",
2084-
"abuse": {
2085-
"role": "abuse",
2086-
"emails": [
2087-
"helpdesk@apnic.net"
2088-
]
2089-
}
2090-
}
2091-
```
2092-
### Lookup Abuse Contact while Excluding Fields
2093-
```typescript
2094-
async function getAbuseContact() {
2095-
try {
2096-
const {data} = await api.getAbuseContactInfo({
2097-
ip: '9.9.9.9',
2098-
excludes: 'abuse.handle,abuse.emails'
2099-
});
2100-
console.log(data);
2101-
} catch (error) {
2102-
console.error('Error fetching location:', error);
2103-
}
2104-
}
2105-
getAbuseContact();
2106-
```
2107-
Sample Response:
2108-
```json
2109-
{
2110-
"ip": "9.9.9.9",
2111-
"abuse": {
2112-
"route": "9.9.9.0/24",
2113-
"country": "",
2114-
"name": "Quad9 Abuse",
2115-
"organization": "Quad9 Abuse",
2116-
"role": "abuse",
2117-
"kind": "group",
2118-
"address": "1442 A Walnut Street Ste 501\nBerkeley\nCA\n94709\nUnited States",
2119-
"phone_numbers": [
2120-
"+1-415-831-3129"
2121-
]
2122-
}
2123-
}
2124-
```
2125-
21262127
## Models
21272128

21282129
- [ASNConnection](https://github.com/IPGeolocation/ip-geolocation-api-typescript-sdk/blob/HEAD/docs/ASNConnection.md)

0 commit comments

Comments
 (0)