Device model name in readable format

I would like to know if there is a reliable/foolproof method to obtain the URL "About This Mac" directs you to when clicking "Specifications" or "Hardware Support"


I am aware of the curl request:


curl -o - "http://support-sp.apple.com/sp/product?cc=DHJP&lang=en_US"


So, for this request, it shows my particular model based on the last 4 characters of my serial:


curl -o - "http://support-sp.apple.com/sp/product?cc=DHJP&lang=en_US"

<?xml version="1.0" encoding="utf-8" ?><root><name>CPU Name</name><configCode>iMac (27-inch, Mid 2011)</configCode><locale>en_US</locale></root>


The thing is, Apple has also used the same request for other systems using only the last 3 characters in the url. And if I only use the last 3 digits of MY serial in this request, curl returns an incorrect model:


curl -o - "http://support-sp.apple.com/sp/product?cc=HJP&lang=en_US"

<?xml version="1.0" encoding="utf-8" ?><root><name>CPU Name</name><configCode>Power Mac G4 (PCI Graphics)</configCode><locale>en_US</locale></root>


Basically, I am trying to do an Alfred2 workflow, that will grab the actual serial number with:


system_profiler SPHardwareDataType | grep 'Serial Number (system)' | awk '{print substr( $0, length($0) - 3, length($0) ) }'


Then, I am sending the last 4 digits into the workflow so that a person can just hit a modifier to goto the appropriate website for either technical specs on their model or the support site for their model ... just like "About This Mac" / "More Info" / "Support" > Specifications does.


IS there a more reliable way to get the model identifier so that the link selected will always return the correct url, regardless of the current 3 or 4 character rules?

iMac, OS X Mountain Lion (10.8.3)

Posted on Apr 3, 2013 3:25 PM

Reply
2 replies

Jun 2, 2013 12:42 PM in response to RodgerWW

Thanks for the tip. I've incorporated this into my EtreCheck (http://www.etresoft.com/etrecheck) utility to help people diagnose problems here on Apple Support Communities.


This seems to be the way that Apple actually does this with the System Information app. I tracked down a private framework that seems to have similar information, but there is no way I could ever get that to work.


Disclaimer: Although EtreCheck is free, there are other links on my site that could give me some form of compensation, financial or otherwise.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Device model name in readable format

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.