I’m helping a local restaurant out with their marketing and technology. Unfortunately the owner’s English is very limited so I wrote the below code to make it easy to use the Google Translate API to convert English to Spanish and Spanish to English (but it would be super easy to adapt it to your language of preference).
Category: API
API- Application Programming Interface
In computer programming, an application programming interface (API) is a set of routines, protocols, and tools for building software and applications.
An API expresses a software component in terms of its operations, inputs, outputs, and underlying types, defining functionalities that are independent of their respective implementations, which allows definitions and implementations to vary without compromising the interface. A good API makes it easier to develop a program by providing all the building blocks, which are then put together by the programmer.
An API may be for a web-based system, operating system, or database system, and it provides facilities to develop applications for that system using a given programming language. As an example, a programmer who develops apps for Android may use an Android API to interact with hardware, like the front camera of an Android-based device.
Extracting text from ResponseBody in API call
Working on an API call with a friend and we ran into a very weird error “No mapping for the Unicode character exists in the target multi-byte code page”.
I tried working through it but couldn’t figure it out so I asked Charlie Simmons (Tank from the AutoHotkey forum) to give me a hand. He worked through it after a bit of trial & error.
Turns out there was some sort of “illegal” character in the ResponseText field that the WinHTTP com object could not handle. You can get the script below, or download my updated API syntax writer.
xmlHTTPRequest vs. WinHTTPRequest- What killer advantages does the xmlRequest have?
In this video I walk through both the xmlHTTPRequest and the WinHTTPRequest and I compare the xmlHTTPRequest vs. WinHTTPRequest. As I mention in the video, Jackie Sztuk and I have a great AutoHotkey webinar on Intro to API calls. I also have several examples on my API page.
I also mention using Fiddler to monitor the browser traffic and grab your cookies / headers.
xmlHTTPRequest vs. WinHTTPRequest tutorial
Here’s the syntax I used for the WinHTTPRequest example
WinHTTPRequest syntax
And here’s the corresponding two XML API calls I demonstrated in the video
xmlHTTPRequest example using Msxml2.XMLHTTP COM object
Here’s the example connecting to the IE page and sending the API request with the xmlHTTPRequest()
API Call with AutoHotkey to pull WordPress Statistics
I stumbled upon something I had worked on years ago to pull stats from WordPress and decided to have a little fun. In this script I show how you can perform API calls with AutoHotkey to extract your stats from WordPress.
Make sure you get our API syntax writer to help you write your code!
API Call with AutoHotkey to pull WordPress Statistics
API Call with AutoHotkey to pull WordPress Statistics