Jump to content
Check out the Spin Axis Podcast! ×

Recommended Posts

Posted

Any of you folk out there programmers? I've been attempting to access the USGA GHIN API via VBA and JSON but, so far have not been completely successful. I've done the usual search thing on the interwebs but I thought I'd check and see if any of you had attempted this as well.

Dagnabbit! Sorry about the case use on the subject line - again.


  • Administrator
Posted

Why would they allow you to do this? And what is it that you're trying to do?

Erik J. Barzeski —  I knock a ball. It goes in a gopher hole. 🏌🏼‍♂️
Director of Instruction Golf Evolution • Owner, The Sand Trap .com • AuthorLowest Score Wins
Golf Digest "Best Young Teachers in America" 2016-17 & "Best in State" 2017-20 • WNY Section PGA Teacher of the Year 2019 :edel: :true_linkswear:

Check Out: New Topics | TST Blog | Golf Terms | Instructional Content | Analyzr | LSW | Instructional Droplets

Awards, Achievements, and Accolades

Posted
13 minutes ago, iacas said:

Why would they allow you to do this? And what is it that you're trying to do?

You would have to ask them why they allow it since they're the ones who created the API. 

I'm doing some "work" for a local golf group (around 80 members). Basically, we need to retrieve hdcps from the API to calculate net scores.


  • Administrator
Posted
40 minutes ago, Zippo said:

You would have to ask them why they allow it since they're the ones who created the API. 

I'm doing some "work" for a local golf group (around 80 members). Basically, we need to retrieve hdcps from the API to calculate net scores.

You're missing my point: why would they allow you to do it? They can create an API for authorized access. They could restrict access any number of ways.

The existence of an API only means that some systems can access it. Not any system.

So, Dozey, I think they've made some changes recently that restricts access to some APIs to authorized programs. you may not be able to do some of the things you may have been able to do four years ago.

Erik J. Barzeski —  I knock a ball. It goes in a gopher hole. 🏌🏼‍♂️
Director of Instruction Golf Evolution • Owner, The Sand Trap .com • AuthorLowest Score Wins
Golf Digest "Best Young Teachers in America" 2016-17 & "Best in State" 2017-20 • WNY Section PGA Teacher of the Year 2019 :edel: :true_linkswear:

Check Out: New Topics | TST Blog | Golf Terms | Instructional Content | Analyzr | LSW | Instructional Droplets

Awards, Achievements, and Accolades

Posted
32 minutes ago, iacas said:

You're missing my point: why would they allow you to do it? They can create an API for authorized access. They could restrict access any number of ways.

The existence of an API only means that some systems can access it. Not any system.

So, Dozey, I think they've made some changes recently that restricts access to some APIs to authorized programs. you may not be able to do some of the things you may have been able to do four years ago.

I get your point. But, all I'm looking to do is pass a ghin number and get back a handicap. Why would they not want me to do that? I can do that by logging into their website and visiting the "Following" page - whether I'm following a golfer or not. The API has a functon to return a handicap index given a ghin number so there's nothing nefarious about the request.

But, you are correct. This is not 4 years ago.

 


  • Administrator
Posted

Because while you’re doing it on a small scale it could be done on a larger one? One that takes resources and would slow the site for others, cost money, etc.?

Maybe it’s possible. I don’t know. Probably not a lot of people hacking at the GHIN API here. 🙃

Erik J. Barzeski —  I knock a ball. It goes in a gopher hole. 🏌🏼‍♂️
Director of Instruction Golf Evolution • Owner, The Sand Trap .com • AuthorLowest Score Wins
Golf Digest "Best Young Teachers in America" 2016-17 & "Best in State" 2017-20 • WNY Section PGA Teacher of the Year 2019 :edel: :true_linkswear:

Check Out: New Topics | TST Blog | Golf Terms | Instructional Content | Analyzr | LSW | Instructional Droplets

Awards, Achievements, and Accolades

Posted

@Zippo A better way would be to simply ask the Admin of the club who hosts your Ghin to send you the daily roster updates via email.
Another method would be to copy and paste the players hdc info needed to a spreadsheet. (an option if you only need an update a few times a week or maybe once)
And as an option, I believe USGA allows groups to form their own group. It still requires the annual fee per player. 
 

Johnny Rocket - Let's Rock and Roll and play some golf !!!

Awards, Achievements, and Accolades

  • Administrator
Posted
22 minutes ago, Club Rat said:

@Zippo A better way would be to simply ask the Admin of the club who hosts your Ghin to send you the daily roster updates via email.

That assumes that he's looking for the GHIN info for members of one club.

22 minutes ago, Club Rat said:

Another method would be to copy and paste the players hdc info needed to a spreadsheet. (an option if you only need an update a few times a week or maybe once)

That's not a viable option to a programmer. "Viable" isn't the right word there because it would "work" but it's not really something a programmer would do for something like what he may be looking to do.

Erik J. Barzeski —  I knock a ball. It goes in a gopher hole. 🏌🏼‍♂️
Director of Instruction Golf Evolution • Owner, The Sand Trap .com • AuthorLowest Score Wins
Golf Digest "Best Young Teachers in America" 2016-17 & "Best in State" 2017-20 • WNY Section PGA Teacher of the Year 2019 :edel: :true_linkswear:

Check Out: New Topics | TST Blog | Golf Terms | Instructional Content | Analyzr | LSW | Instructional Droplets

Awards, Achievements, and Accolades

Posted
1 hour ago, iacas said:

That's not a viable option to a programmer. "Viable" isn't the right word there because it would "work" but it's not really something a programmer would do for something like what he may be looking to do.

True, but his objective is to simply obtain the groups (80 players is a small group) daily hdcp updates.

And / IF the group maintains their hdcp all from the club / association, then having the admin send him a daily report is a simple solution. Our groups did have players from various courses and often we had guests play.
For them it required a manual lookup. I used the copy and paste method from my friends list for those players who were members at different cubs, no biggie. 

Also, not knowing the timeframe requirements needed, daily, once a week, twice a week, he could request reports for only days required. 

And as you mentioned, the USGA will not likely grant him access to the data unless he forms his own group and pays the annual fee per player maintained. 

Johnny Rocket - Let's Rock and Roll and play some golf !!!

Awards, Achievements, and Accolades

  • Administrator
Posted
9 hours ago, Club Rat said:

IF the group maintains their hdcp all from the club

Well that's a big leap.

And it still requires a lot more work than pulling the selected data from an array of GHIN #s and pre-filling stuff out programmatically.

Erik J. Barzeski —  I knock a ball. It goes in a gopher hole. 🏌🏼‍♂️
Director of Instruction Golf Evolution • Owner, The Sand Trap .com • AuthorLowest Score Wins
Golf Digest "Best Young Teachers in America" 2016-17 & "Best in State" 2017-20 • WNY Section PGA Teacher of the Year 2019 :edel: :true_linkswear:

Check Out: New Topics | TST Blog | Golf Terms | Instructional Content | Analyzr | LSW | Instructional Droplets

Awards, Achievements, and Accolades

Posted
2 hours ago, iacas said:

Well that's a big leap.

And it still requires a lot more work than pulling the selected data from an array of GHIN #s and pre-filling stuff out programmatically.

Exactly. But, if it ain't doable then it ain't doable. I think I'm close, though. It's now returning an "invalid email/password" error where previously it was returning a no content error. That tells me that I'm probably not formating that data correctly when I send it to the API.

I did send a request for info to the USGA GHIN folk, but I'll be very surprised if I get a response. I'm sure they're shorthanded and busy like everyone else.


Posted
On 2/28/2022 at 7:21 PM, Zippo said:

Exactly. But, if it ain't doable then it ain't doable. I think I'm close, though. It's now returning an "invalid email/password" error where previously it was returning a no content error. That tells me that I'm probably not formating that data correctly when I send it to the API.

I did send a request for info to the USGA GHIN folk, but I'll be very surprised if I get a response. I'm sure they're shorthanded and busy like everyone else.

So, I did get an answer to my request for info from the USGA GHIN folk. It wasn't the answer I was hoping for, but I do sincerely appreciate them getting back to me. Basically, what he said was, "they have a requirement that your software supports 10 clubs or 1,400 golfers." That's clear enough so I'll get with the league folk and see about other options.


  • Administrator
Posted
2 hours ago, Zippo said:

So, I did get an answer to my request for info from the USGA GHIN folk. It wasn't the answer I was hoping for, but I do sincerely appreciate them getting back to me. Basically, what he said was, "they have a requirement that your software supports 10 clubs or 1,400 golfers." That's clear enough so I'll get with the league folk and see about other options.

In other words, we can't just have everyone scraping our stuff for piddly little stuff. 😄

Erik J. Barzeski —  I knock a ball. It goes in a gopher hole. 🏌🏼‍♂️
Director of Instruction Golf Evolution • Owner, The Sand Trap .com • AuthorLowest Score Wins
Golf Digest "Best Young Teachers in America" 2016-17 & "Best in State" 2017-20 • WNY Section PGA Teacher of the Year 2019 :edel: :true_linkswear:

Check Out: New Topics | TST Blog | Golf Terms | Instructional Content | Analyzr | LSW | Instructional Droplets

Awards, Achievements, and Accolades

Posted
On 2/28/2022 at 7:51 AM, Club Rat said:

@Zippo
Another method would be to copy and paste the players hdc info needed to a spreadsheet.
 

His “club” should be able to do that without copy and paste. Unless the system has changed. I did that a couple of years ago to set up a book for a tournament.

Bill M

Awards, Achievements, and Accolades

Posted
57 minutes ago, phan52 said:

His “club” should be able to do that without copy and paste. Unless the system has changed. I did that a couple of years ago to set up a book for a tournament.

Sorry. There is no club.

2 hours ago, iacas said:

In other words, we can't just have everyone scraping our stuff for piddly little stuff. 😄

Yeah. Actually, I probably could scrape the info off their website at the "following page" but that's closer to "hacking" than I'm comfortable doing and it's far more resource intensive on their site than the API would have been.  No worries. There's always a plan B.


  • 9 months later...
  • 1 year later...
Posted

I know this is an old thread, but I have some code written in python to pull handicaps from the GHIN system.

I wound up here because I was curious if there is a public API for the GHIN system.  Does anyone know?

Let me know if you need the python code...

  • Like 1

  • Administrator
Posted
12 minutes ago, howiekrauth said:

I know this is an old thread, but I have some code written in python to pull handicaps from the GHIN system.

I wound up here because I was curious if there is a public API for the GHIN system.  Does anyone know?

Let me know if you need the python code...

There is not, to my knowledge.

Erik J. Barzeski —  I knock a ball. It goes in a gopher hole. 🏌🏼‍♂️
Director of Instruction Golf Evolution • Owner, The Sand Trap .com • AuthorLowest Score Wins
Golf Digest "Best Young Teachers in America" 2016-17 & "Best in State" 2017-20 • WNY Section PGA Teacher of the Year 2019 :edel: :true_linkswear:

Check Out: New Topics | TST Blog | Golf Terms | Instructional Content | Analyzr | LSW | Instructional Droplets

Awards, Achievements, and Accolades

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


  • Want to join this community?

    We'd love to have you!

    Sign Up
  • TST Partners

    Carl's Place
    PlayBetter
    Golfer's Journal
    ShotScope
    The Stack System
    FitForGolf
    FlightScope Mevo

    Coupon Codes (save 10-20%): "IACAS" for Mevo/Stack/FitForGolf, "IACASPLUS" for Mevo+/Pro Package, and "THESANDTRAP" for ShotScope. 15% off TourStriker (no code).
  • Posts

    • Day 610 - 2026-06-03 Got some work in between lessons today. Rare late day, teaching until 7:30pm.
    • Let's continue on… Cool. The thing is, nobody's claiming par is "reliable" and par's inclusion piggy-backs in the course rating, which is awfully close to par and, thus, brings par in to make it make sense. Once again, for those in the back… (CR - Par) just makes it really easy to know what kind of score you need to shoot to best, match, or play worse than your handicap index. Yes, when par is different, the players from the higher par tees get an extra stroke (72 vs. 71, the 72s get an extra stroke. That makes sense and is a small complication (more info at https://www.usga.org/content/usga/home-page/handicapping/roh/Content/rules/Committee%20Content/USGA/LG_R6d.htm). However, most of the time, this adjustment will not be needed, as many courses play to the same par for the same genders from all sets of tees. And, the rare times it is needed, par (measured in whole numbers, integers) and strokes (also whole numbers/integers) map easily and the idea is easily grasped. Dean seems to be unaware of the fact that most every golfer carries something orders of magnitude more powerful than the highest end desktop computers available the last time he consulted with the USGA in their pockets. While it is quaint that his club puts printouts by the first tee… get with the times, Dean. Look up your handicap index and course handicap in the GHIN app and get on with it. It's a better system than the one that didn't account — at all — for a difference in the playing conditions (via an algorithm, not a judgment). Dean's assertions about the "less precise system because of par" continues to make absolutely zero sense. Right, it still changed tee to tee. Now it just changes differently… and in a way that more accurately reflects the score you need to shoot to play to your handicap. Previously, a 1.1 index would get 1 stroke on a 66.7/122 par-72 course. Now they give four strokes back to the course and must shoot 68 to play to their handicap. This makes way more sense. The 18-shot difference is a pretty extreme example. Maybe a long course that also offers a par-three set of tees could play that long, but… man, that's not going to be super common. Sensationalistic much, Dean? Also, once those unhappy (complete assumption) golfers realize a) what the change shows them (playing to net par = playing to your index) and b) realizes that their differential is going to be the same… I think they'll get over their initial questions. No. And yet… if he shoots the same scores, he'll get the same handicap index he has now. But he'll know on each course what score he needs to shoot to "play to his handicap." Sheesh, Dean. This stuff isn't that hard to figure out. Enough with the sensationalistic stuff. I don't find it "unacceptable" at all. Then again, I'm not nearly 80 and seemingly incapable of doing basic math these days. No. This literally makes no sense, as that part of the differential calculation and the course handicap calculation remains identical. Good! No. Categorically wrong. They should have been adjusting their handicaps all along. Previously it was by subtracting the course ratings. Which… is still basically what's done, with the addition of the course rating being "baked in" to the course handicap calculation. Dean is wrong here, or doing some math heretofore unknown by the world. When par is the same, what determines the difference in handicaps? The course rating, which Dean loves! Sheesh! You had to things when players were in situations like this before, too. This is getting exhausting. He keeps using words like "less precise" and "unfair" but does not seem to understand what they mean. This is like the Princess Bride meme: "you keep using that word. I do not think it means what you think it means." The caps reduce upward movement. Committees have reign to reduce a player's handicap, and there's still an automatic Exceptional Score Reduction. I'm going through these more quickly now because… well, it's silly how badly Dean misses the mark with this blog post. Dean is literally confusing the upward movement (with the soft and hard caps) here with the exceptional score reduction which is used when lowering handicaps due to an exceptionally good score. The creators of the WHS are handicap experts. They know more about the current state of handicaps/handicapping than the Pope Emeritus. It's been shown to have almost no effect across all handicaps. Yes, some 36s under the old system are now 35s under the new system. Yawn. He should have stopped there. It's easier to apply and makes more sense. This makes no sense. It's "not complex" but players will have to guess? And, for men or women, the stroke index of each hole doesn't change because they play a different set of tees. They get a different number of strokes, but it's always been true that when you get 14 strokes you apply a stroke to stroke index holes 1-14, and when you get 11, to just holes with a SI of 1-11. Objection, your honor. Assumes facts not in evidence. Dean's just out here continuing to make shit up about "the inaccuracy of par" and ignoring that with Par (an integer) came the Course Rating, which he agrees is precise and accurate. No. No, this is inaccurate. Also, as noted, you can randomly assign stroke indexes, and so long as all the low numbers or all the high numbers are not clumped together at the beginning or ends of the 18 holes, matches generally work out the same. This is inaccurate. It is an algorithm that looks at scores. That's it. Also, this is better than a system like the prior one where no such thing existed at all. Wildly inaccurate and off-base. Did they do actual testing? No need. They have millions and millions of rounds and ran many, many, many simulations. That's testing. Dean seems to continue to be unaware of the fact that computers are more powerful now than they were in 2002. But, he's nearly 80, so we can understand if not going so far as to give him a pass on how much he gets wrong. Cool. Noted. For the most part that was because many countries haven't been able to rate enough of their courses. :sigh:
    • Day 3 (3 Jun 26) - More work on keeping arms connected today - hard foam balls with 7i and 5w…..
    • Day 274 6-3 flow drill getting chest through, arms in front. Arms get a little pinned to the side, not as much in front as I want them when I add speed. 
    • Shot 48 yesterday.  For me bogey golf is good.  I was 10 over through 7 and figured with a Par 3 and 4 coming on all I needed was birdie / par to get my 45. I had a great tee shot on #8 and sunk  a 5 footer for birdie, game was coming together, now just needed par on #9. Had a great tee drive and the green was within range for a hoped GIR or nGIR.  But I pulled the shot left into tall weeds and needed to take a drop.  So much for par, but a bogey for 46 is still good for me. I hit my lob wedge to get over a small tree and saw the ball riding nicely  on line to the pin when my club hit the ball a 2nd time on my follow through causing the ball to change directions and ended up @ pin high but along the same tall weeds I just took an unplayable out of.  had no room for a backswing, Just hacked at it and it shot across the green to the rough on the far side.  Needed a chip & 1 putt got a triple bogey. you can see the hole fall apart in the screenshot below.  
×
×
  • Create New...

Important Information

Welcome to TST! Signing up is free, and you'll see fewer ads and can talk with fellow golf enthusiasts! By using TST, you agree to our Terms of Use, our Privacy Policy, and our Guidelines.