IP2Location provides a number of API calls that can be used to determine the location of an IP address. This can be useful for a number of applications, including:
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
ip2location: {
type: "app",
app: "ip2location",
},
ip: {
type: "string",
default: "142.113.220.31"
},
package: {
type: "string",
default: "WS1"
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.ip2location.com/v2`,
params: {
key: `${this.ip2location.$auth.api_key}`,
ip: `${this.ip}`,
package: `${this.package}`,
},
})
},
})
Query IP address using IP2Location API. See the docs here for how to use this API.
IP2Location uses API keys for authentication. When you connect your IP2Location account, Pipedream securely stores the keys so you can easily authenticate to IP2Location APIs in both code and no-code steps.
Access your API key from the License section in your IP2Location account in order to make authenticated requests to their API.