Trailhead seems to have an API to access trailhead data about badges, project, modules, roles, users etc. but it requires an API key to use. Does anybody know how to get any API key to use this API?
4 Answers
You will need to contact Trailhead to get an official X-API-Key
key to use in the header. Try [email protected] initially.
I believe you also need to have your IP address whitelisted against the key. E.g. If you call the API with a random key you get a response along the line of:
{ "message": "Client not allowed : REMOTE_IP -> [104.156.92.21] IP -> [104.156.92.21] X- 71.241.141.120, 104.156.92.21" }
Via details that have leaked out via forums, there appears to be a "Trailhead API" module with a "Search Using the Trailhead API" challenge, but it isn't available to the public via Trailhead.
-
Good to know this internal information, I reached out to Salesforce for same and they have confirmed that TrailHead API is not public. Apr 15, 2018 at 8:54
-
-
@AdrianLarson Ha! Someone has intentionally removed them by the looks of it. Jan 5, 2019 at 5:57
I have built a custom app on heroku which provides public access to Trailhead API. However, it hangs for some user profiles (not sure why). While for the others it works just fine.
This is a hack implementation to get access to Trailhead API to get Trailhead user points and other attributes. Requests should be used in the form https://trailheadapi.herokuapp.com/?link=/id/userAlias
It is possible to deploy code to your own heroku instance https://github.com/Patlatus/Salesforce-Trailhead-Api-Hack
-
This API is also not working , giving this message - {"error": "Need to update our code", "descriptor": "markup://aura:clientOutOfSync"} May 15, 2020 at 8:18
I have searched a lot for the API to get the trailblazer user data, but didn't get any single API working. Finally, I have created the API. Use this,
https://trailheadtrackerapi.herokuapp.com/?id=Username
you will get this response
{"EarnedBadgeTotal":"value","EarnedPointTotal":"value","CompletedTrailTotal":"value"}
-
This app is now returning the Heroku application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command heroku logs --tail
– kreynenSep 28, 2020 at 13:53 -
Hi @kreynen, I am using free plan of Heroku, this error may come at the end of the month when my dyno hours per month expires. Today I tested, it is up again. Oct 1, 2020 at 12:29
-
2Thanks! Can you share the repo so other people can spin a an instance of it? Since this was broken, it forced me to look at how trailblazer.me/aura?r=0&aura.ApexAction.execute=2 works. It looks like the only unique value needed in the POST is the user's Trailhead uid. Since what I'm building is an app that tracks trailhead progress over time, I can look up the uid as users are added, but I still appreciate seeing how other developers are getting this information.– kreynenOct 2, 2020 at 14:32
-
Chris Duarte, Senior Director and Editor-in-Chief, Trailhead at Salesforce confirmed that TrailHead API is not public and there is no plan to make it public in near future.