External Data operator usage

%3CLINGO-SUB%20id%3D%22lingo-sub-2252890%22%20slang%3D%22en-US%22%3EExternal%20Data%20operator%20usage%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2252890%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20import%20information%20on%20a%20specific%20IP%20from%20a%20site%2C%20using%20the%20externaldata%20operator.%3C%2FP%3E%3CP%3EI%20want%20to%20forward%20the%20URL%20to%20the%20command%20as%20a%20function%20as%20below%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3Elet%20url%20%3D%20'http%3A%2F%2Fip-api.com%2Fjson%2F8.8.8.8'%3B%0Alet%20IP_Info%20%3D%20(URL%3Astring)%20%7Bexternaldata(status%3Astring%2C%20continent%3Astring%2C%20country%3Astring%2C%20regionName%3Astring%2C%20city%3Astring%2C%20isp%3Astring%2C%20org%3Astring%2C%20proxy%3Astring%2C%20hosting%3Astring%2C%20query%3Astring)%20%0A%5B%20%0A%20%20%20%40'URL'%0A%5D%0Awith(format%3D'json')%0A%7D%3B%0AIP_Info(url)%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3BIs%20this%20possible%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20addition%2C%20is%20url%20in%20the%20below%20form%20is%20valid%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fip-api.com%2Fjson%2F24.48.0.1%3Ffields%3D17983001%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Eip-api.com%2Fjson%2F8.8.8.8%3F%3CFONT%20color%3D%22%23FF6600%22%3Efields%3D17983001%3C%2FFONT%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2252890%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eothers%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EQuery%20Language%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hi everyone,

 

I am trying to import information on a specific IP from a site, using the externaldata operator.

I want to forward the URL to the command as a function as below:

 

let url = 'http://ip-api.com/json/8.8.8.8';
let IP_Info = (URL:string) {externaldata(status:string, continent:string, country:string, regionName:string, city:string, isp:string, org:string, proxy:string, hosting:string, query:string) 
[ 
   @'URL'
]
with(format='json')
};
IP_Info(url)

 

 Is this possible?

 

In addition, is url in the below form is valid: 

ip-api.com/json/8.8.8.8?fields=17983001

 

Thanks!

0 Replies