Skip to content

Commit 08eb0b0

Browse files
committed
Added Hosted Domain API for IP2Location.io Integration
1 parent cdca53c commit 08eb0b0

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import ip2location from "../../ip2location_io.app.mjs";
2+
3+
export default {
4+
key: "ip2location_io-lookup-hosted-domain",
5+
name: "Lookup Hosted Domain",
6+
description: "Retrieve the list of hosted domains on an IP Address. [See the docs here](https://www.ip2location.io/ip2whois-domains-documentation)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
ip2location,
11+
ip: {
12+
type: "string",
13+
label: "IP Address",
14+
description: "IP address (IPv4 or IPv6) to lookup",
15+
},
16+
format: {
17+
propDefinition: [
18+
ip2location,
19+
"format",
20+
],
21+
},
22+
page: {
23+
type: "integer",
24+
label: "Page",
25+
description: "Pagination result returns of the hosted domains. If unspecified, 1st page will be used.",
26+
optional: true,
27+
},
28+
},
29+
async run({ $ }) {
30+
const response = await this.ip2location.lookupHostedDomain({
31+
params: {
32+
ip: this.ip,
33+
format: this.format,
34+
page: this.page,
35+
},
36+
});
37+
38+
if (response) {
39+
$.export("$summary", `Successfully retrieved hosted domains about IP ${this.ip}.`);
40+
}
41+
42+
return response;
43+
},
44+
};

components/ip2location_io/ip2location_io.app.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,11 @@ export default {
4040
...args,
4141
});
4242
},
43+
lookupHostedDomain(args = {}) {
44+
return this._makeRequest({
45+
url: "https://domains.ip2whois.com/domains",
46+
...args,
47+
});
48+
},
4349
},
4450
};

components/ip2location_io/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/ip2location_io",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Pipedream IP2Location.io Components",
55
"main": "ip2location_io.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)