Edits history of script submission #393 for ' Get IP address insights from IPinfo - geolocation, privacy detection, company and more (ipinfo)'

  • deno
    // import * as wmill from 'https://deno.land/x/windmill/index.ts'
    
    type Ipinfo {
        token: string
    }
    
    export async function main(ipinfo?: Ipinfo, ip?:string) {
        /**
         * Makes an API call to IPinfo to get IP address geolocation data and other IP data.
         * @param {string} token - Your IPinfo.io access token. This param is optional.
         * @param {string} ip - The IP address to lookup. This param is optional if you want to lookup your current IP.
         * @returns {object} - An object with the status and the payload.
         */
        const ipAddressInformation = await fetch(`https://ipinfo.io${ip ? '/' + ip : '' }/json?token=${ipinfo?.token || ""}`)
    
        return {
            status: ipAddressInformation.status,
            payload: await ipAddressInformation.json(),
        };
    }

    Submitted by hugo697 398 days ago

  • deno
    // import * as wmill from 'https://deno.land/x/windmill/index.ts'
    
    type Ipinfo {
        token: string
    }
    
    export async function main(ipinfo?: Ipinfo, ip?:string) {
        /**
         * Makes an API call to IPinfo to get IP address geolocation data and other IP data.
         * @param {string} token - Your IPinfo.io access token. This param is optional.
         * @param {string} ip - The IP address to lookup. This param is optional if you want to lookup your current IP.
         * @returns {object} - An object with the status and the payload.
         */
        const ipAddressInformation = await fetch(`https://ipinfo.io${ip ? '/' + ip : '' }/json?token=${ipinfo?.token || ""}`)
    
        return {
            status: ipAddressInformation.status,
            payload: await ipAddressInformation.json(),
        };
    }

    Submitted by rubenfiszel 1084 days ago

  • deno
    // import * as wmill from 'https://deno.land/x/windmill/index.ts'
    
    export async function main(token?: string, ip?:string) {
        /**
         * Makes an API call to IPinfo to get IP address geolocation data and other IP data.
         * @param {string} token - Your IPinfo.io access token. This param is optional.
         * @param {string} ip - The IP address to lookup. This param is optional if you want to lookup your current IP.
         * @returns {object} - An object with the status and the payload.
         */
        const ipAddressInformation = await fetch(`https://ipinfo.io${ip ? '/' + ip : '' }/json?token=${token || ""}`)
    
        return {
            status: ipAddressInformation.status,
            payload: await ipAddressInformation.json(),
        };
    }

    Submitted by devrel.ipinfo250 1084 days ago