PA lottery uses aspx file to present tables of draw history.

Published:

Updated:

Microsoft Active Server Pages, the technology used by the PA lottery to present 1 year of draw history for any of their games.

There are 2 main variables passed via query string parameters, the id, tells it which game to display, and year, so you can choose the year.

I can fetch a requested page by passing in variables for the task at hand.

For example, this is the full url to display the PA pick 3 evening results for 2025...

https://www.palottery.state.pa.us/Games/Print-Past-Winning-Numbers.aspx?id=2&year=2025&print=1

I forget exactly how I found it, it was originally buried somewhere on their results pages. Through experimentation, I found the following game ID codes...

1. Pick 3 Mid Day

2. Pick 3 Evening (the example above)

3. Pick 4 Mid Day

4. Pick 4 Evening

5. Pick 5 Mid Day

6. Pick 5 Evening

7. Treasure Hunt

8. Cash 5

11. Match 6

12. Power Ball

15. Mega Millions

27. Pick 2 Evening

31. Pick 2 Mid Day

35. Cash 4 Life

(There are codes for games that have ended like 10 for Mix & Match and 14 for Super 7, but if the game ended.. why bother?)

By replacing the id value with a number from above and the year value desired, you can see any full calendar year of PA lottery game history.

The Pick 3 evening is the longest running PA game and goes back to 1977 !

In my build script, I loop each ID through the years for each game ID and create a csv file for each.

The update version that I plan on running once a week will go through ALL of the game IDs for the current year, updating all 14 games in one shot.

I am still stuck on 3 games... all have a bonus ball. Since the other 11 games all work, I am going to create a separate script that can handle bonus balls... working on that today... the idea is to only grab numeric data and only use the first 6 in the list, this will effectively capture all of the 3 games and ignore the power play and double draw data. Also will skip the megaplier pre $5 era.

Also note that if importing via spreadsheet, the date is in a text date format. I handle that conversion into an actual date type in Python, but it is also able to do this in a spreadsheet by using "paste special" and choosing unformatted text, then for the date column, select "Date M/D/Y"... problem solved... text dates don't sort properly, particularly if mixed with standard dates!

So that is where I am at with the coding project, just thought I would share the URL I found to make gathering history easier for any other PA players out there.

Entry #548

Comments

This Blog entry currently has no comments.

Post a Comment

Please Log In

To use this feature you must be logged into your Lottery Post account.

Not a member yet?

If you don't yet have a Lottery Post account, it's simple and free to create one! Just tap the Register button and after a quick process you'll be part of our lottery community.

Register