Purpose: Stereotactic radiosurgery (SRS) and stereotactic body radiation therapy (SBRT) treatments require a high degree of accuracy. Mechanical, imaging, and radiation isocenter coincidence is especially important. As a common method, the Winston-Lutz (WL) test plays an important role. However, weekly or daily WL test can be very time consuming. We developed novel methods using Portal Dosimetry Scripting Application Programming Interface (PDSAPI) to facilitate the test as well as documentation. Methods: Winston-Lutz PDSAPI was developed and tested on our routine weekly WL imaging. The results were compared against two commercially available software RIT (Radiological Imaging Technology, Colorado Springs, CO) and DoseLab (Varian Medical Systems, Inc. Palo Alto, CA). Two manual methods that served as ground truth were used to verify PDSAPI results. Twenty WL test image data sets (10 fields per tests, and 200 images in total) were analyzed by these five methods in this report. Results: More than 99.5% of WL PDSAPI 1D shifts agreed with each of four other methods within ±0.33 mm, which is roughly the pixel width of a-Si 1200 portal imager when source to imager distance (SID) is at 100 cm. 1D shifts agreement for ±0.22 mm and 0.11 mm were 96% and 63%, respectively. Same trend was observed for 2D displacement. Conclusions: Winston-Lutz PDSAPI delivers similar accuracy as two commercial applications for WL test. This new application can save time spent transferring data and has the potential to implement daily WL test with reasonable test time. It also provides the data storage capability, and enables easy access to imaging and shift data.