Jump to content

Is it possible to call a http without opening a browser and...

Recommended Posts


Hi. I'm new to autoit and been reading for awhile. I know some basics but I can't seem to figure out one problem. At work we often do a query to medicare database but it is tiresome opening a browser every time.

I want to make a simple script that will save the result of the browser into a variable without opening a browser.

The URL to open. 


The result to store in a variable.


At work the NPI is always given. I know how to replace it with a variable and I know how to messagebox the result. Just don't know how to send the URL without opening a browser and putting the result in a variable.

If you can provide the pseudo code or command or an example, I will truly appreciate it guys. Thank you.



Share this post

Link to post
Share on other sites

Thank you. I tried to read it and honestly don't understand it, I guess not equip to handle programming. My profession is basically in health services. I can understand mousemove, mouseclick, variables, if else, a little bit of functions, etc but not  the caliber of Trancexxx programming too complex for me.  TY again.

Share this post

Link to post
Share on other sites

To make requests to this site you must register, then get a token, then include this token in the request
A simple workaround could be to download the whole dataset (about 32 MB) in csv format so you can afterwards locally search inside using a simple script

#Include <Array.au3>
$csv = FileRead("Order_and_Referring.csv")
$npi = "1427499813"
$res = StringRegExp($csv, '(' & $npi & '),(\w+),(\w+)', 1)


Share this post

Link to post
Share on other sites

Here's a script that retrieves the JSON info from that url, to get you going :

#include "WinHttp.au3"
Local $id = 1427499813
Local $site = "https://data.cms.gov"
Local $url = "resource/iadr-zq3i.json?npi=" & $id
; Open needed handles
Local $hOpen = _WinHttpOpen()
Local $hConnect = _WinHttpConnect($hOpen, $site)
; Specify the reguest:
Local $hRequest = _WinHttpOpenRequest($hConnect, Default, $url, Default, Default, Default, $WINHTTP_FLAG_SECURE)
; Send request
; Wait for the response
Local $jsondata = _WinHttpReadData($hRequest)
; Clean
; Display retrieved json
ConsoleWrite('@@ $jsondata = ' & $jsondata & @CRLF )


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now