Announcement

Collapse
No announcement yet.

Is there a web api to get the basic CPU spec info?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a web api to get the basic CPU spec info?

    Hi,
    Thanks for the info provided by PassMark! That helps me to find my most wanted CPU to build my PC.

    I want to buy a powerfull CPU, but in efficiency meanwhile.

    But in the Power Performance page, the TDP/Rating/Core/Thread numbers are not shown and cannot sort/filter them.
    So I create a python script to sort/filter them:

    Code:
    @dataclass
    class CPU:
        name: str
        cores: int = 0
        threads: int = 0
        tdp: float = 0
        rating: int = 0
        url: str = ''
    
    
    def power_perf():
        url = 'https://www.cpubenchmark.net/power_performance.html'
        soup = BeautifulSoup(requests.get(url).content, 'html.parser')
        if allcpu := soup.find('div', {'id': 'allcpu'}):
            for cpu in allcpu.find_all('li'):
                name = cpu.find('span', {'class': 'prdname'}).text
                href = 'https://www.cpubenchmark.net/' + cpu.find('a').get('href')
                details = cpu.find('span', {'class': 'more_details'})
                items = re.split(r'\s*,\s*', details.get('onclick')[2:-2])
                rank, rating, tdp = int(items[1]), int(items[6][1:-1]), float(items[7][1:-1])
                yield rank, CPU(name, rating=rating, url=href, tdp=tdp)
    ​
    And got the result:
    Click image for larger version

Name:	image.png
Views:	597
Size:	70.4 KB
ID:	56114

    But I cannot get other basic info, such as Core / Thread numbers.
    So is there a Web Api to get such info without parsing raw html?​

    Thanks!

  • #2
    Sorting and filtering is available on the CPU Megalist page.

    But the TDP/Rating/Core/Thread number isn't super useful for many reasons. For example, CPUs rarely run at their TDP value and threads count for a lot less than a full core. Plus you have P cores and E Cores, which aren't equal.

    We license the data as a CSV dump. Details are here.

    Comment


    • #3
      Originally posted by David (PassMark) View Post
      Sorting and filtering is available on the CPU Megalist page.
      That's Great!
      Then I no need the web API.
      THANKS!!

      Comment

      Working...
      X