1
Fork 0
This repository has been archived on 2021-11-25. You can view files and clone it, but cannot push or open issues or pull requests.
Project_Steam_Tracker/steam_api.py

416 lines
26 KiB
Python

import requests
def getappdata(appid):
"""
voorbeeld json response:
{
"730": {
"success": true,
"data": {
"type": "game",
"name": "Counter-Strike: Global Offensive",
"steam_appid": 730,
"required_age": 0,
"is_free": true,
"controller_support": "full",
"dlc": [
1490530
],
"detailed_description": "<h1>Just Updated</h1><p><a href=\"https://store.steampowered.com/app/1490530/CounterStrike_Global_Offensive__Operation_Broken_Fang/\" target=\"_blank\" rel=\"noreferrer\" id=\"dynamiclink_0\" >https://store.steampowered.com/app/1490530/CounterStrike_Global_Offensive__Operation_Broken_Fang/</a></p><br><h1>About the Game</h1>Counter-Strike: Global Offensive (CS: GO) expands upon the team-based action gameplay that it pioneered when it was launched 19 years ago.<br><br>CS: GO features new maps, characters, weapons, and game modes, and delivers updated versions of the classic CS content (de_dust2, etc.).<br><br>&quot;Counter-Strike took the gaming industry by surprise when the unlikely MOD became the most played online PC action game in the world almost immediately after its release in August 1999,&quot; said Doug Lombardi at Valve. &quot;For the past 12 years, it has continued to be one of the most-played games in the world, headline competitive gaming tournaments and selling over 25 million units worldwide across the franchise. CS: GO promises to expand on CS' award-winning gameplay and deliver it to gamers on the PC as well as the next gen consoles and the Mac.&quot;",
"about_the_game": "Counter-Strike: Global Offensive (CS: GO) expands upon the team-based action gameplay that it pioneered when it was launched 19 years ago.<br />\r\n<br />\r\nCS: GO features new maps, characters, weapons, and game modes, and delivers updated versions of the classic CS content (de_dust2, etc.).<br />\r\n<br />\r\n&quot;Counter-Strike took the gaming industry by surprise when the unlikely MOD became the most played online PC action game in the world almost immediately after its release in August 1999,&quot; said Doug Lombardi at Valve. &quot;For the past 12 years, it has continued to be one of the most-played games in the world, headline competitive gaming tournaments and selling over 25 million units worldwide across the franchise. CS: GO promises to expand on CS' award-winning gameplay and deliver it to gamers on the PC as well as the next gen consoles and the Mac.&quot;",
"short_description": "Counter-Strike: Global Offensive (CS: GO) expands upon the team-based action gameplay that it pioneered when it was launched 19 years ago. CS: GO features new maps, characters, weapons, and game modes, and delivers updated versions of the classic CS content (de_dust2, etc.).",
"supported_languages": "Czech, Danish, Dutch, English<strong>*</strong>, Finnish, French, German, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Portuguese - Brazil, Romanian, Russian, Simplified Chinese, Spanish - Spain, Swedish, Thai, Traditional Chinese, Turkish, Bulgarian, Ukrainian, Greek, Spanish - Latin America, Vietnamese<br><strong>*</strong>languages with full audio support",
"header_image": "https://steamcdn-a.akamaihd.net/steam/apps/730/header.jpg?t=1610576424",
"website": "http://blog.counter-strike.net/",
"pc_requirements": {
"minimum": "<strong>Minimum:</strong><br><ul class=\"bb_ul\"><li><strong>OS:</strong> Windows® 7/Vista/XP<br></li><li><strong>Processor:</strong> Intel® Core™ 2 Duo E6600 or AMD Phenom™ X3 8750 processor or better<br></li><li><strong>Memory:</strong> 2 GB RAM<br></li><li><strong>Graphics:</strong> Video card must be 256 MB or more and should be a DirectX 9-compatible with support for Pixel Shader 3.0<br></li><li><strong>DirectX:</strong> Version 9.0c<br></li><li><strong>Storage:</strong> 15 GB available space</li></ul>"
},
"mac_requirements": {
"minimum": "<strong>Minimum:</strong><br><ul class=\"bb_ul\"><li><strong>OS:</strong> MacOS X 10.11 (El Capitan) or later<br></li><li><strong>Processor:</strong> Intel Core Duo Processor (2GHz or better)<br></li><li><strong>Memory:</strong> 2 GB RAM<br></li><li><strong>Graphics:</strong> ATI Radeon HD 2400 or better / NVidia 8600M or better<br></li><li><strong>Storage:</strong> 15 GB available space</li></ul>"
},
"linux_requirements": {
"minimum": "<strong>Minimum:</strong><br><ul class=\"bb_ul\"><li><strong>OS:</strong> Ubuntu 12.04<br></li><li><strong>Processor:</strong> 64-bit Dual core from Intel or AMD at 2.8 GHz<br></li><li><strong>Memory:</strong> 4 GB RAM<br></li><li><strong>Graphics:</strong> nVidia GeForce 8600/9600GT, ATI/AMD Radeon HD2600/3600 (Graphic Drivers: nVidia 310, AMD 12.11), OpenGL 2.1<br></li><li><strong>Storage:</strong> 15 GB available space<br></li><li><strong>Sound Card:</strong> OpenAL Compatible Sound Card</li></ul>"
},
"developers": [
"Valve",
"Hidden Path Entertainment"
],
"publishers": [
"Valve"
],
"packages": [
329385,
298963,
54029
],
"package_groups": [
{
"name": "default",
"title": "Buy Counter-Strike: Global Offensive",
"description": "",
"selection_text": "Select a purchase option",
"save_text": "",
"display_type": 0,
"is_recurring_subscription": "false",
"subs": [
{
"packageid": 298963,
"percent_savings_text": " ",
"percent_savings": 0,
"option_text": "Counter-Strike: Global Offensive - Free",
"option_description": "",
"can_get_free_license": "0",
"is_free_license": true,
"price_in_cents_with_discount": 0
},
{
"packageid": 54029,
"percent_savings_text": " ",
"percent_savings": 0,
"option_text": "CS:GO Prime Status Upgrade - 13,25€",
"option_description": "",
"can_get_free_license": "0",
"is_free_license": false,
"price_in_cents_with_discount": 1325
}
]
}
],
"platforms": {
"windows": true,
"mac": true,
"linux": true
},
"metacritic": {
"score": 83,
"url": "https://www.metacritic.com/game/pc/counter-strike-global-offensive?ftag=MCD-06-10aaa1f"
},
"categories": [
{
"id": 1,
"description": "Multi-player"
},
{
"id": 22,
"description": "Steam Achievements"
},
{
"id": 28,
"description": "Full controller support"
},
{
"id": 29,
"description": "Steam Trading Cards"
},
{
"id": 30,
"description": "Steam Workshop"
},
{
"id": 35,
"description": "In-App Purchases"
},
{
"id": 8,
"description": "Valve Anti-Cheat enabled"
},
{
"id": 15,
"description": "Stats"
},
{
"id": 41,
"description": "Remote Play on Phone"
},
{
"id": 42,
"description": "Remote Play on Tablet"
},
{
"id": 43,
"description": "Remote Play on TV"
}
],
"genres": [
{
"id": "1",
"description": "Action Games"
},
{
"id": "37",
"description": "Free to Play"
}
],
"screenshots": [
{
"id": 0,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_34090867f1a02b6c17652ba9043e3f622ed985a9.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_34090867f1a02b6c17652ba9043e3f622ed985a9.1920x1080.jpg?t=1610576424"
},
{
"id": 1,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_1d30c9a215fd621e2fd74f40d93b71587bf6409c.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_1d30c9a215fd621e2fd74f40d93b71587bf6409c.1920x1080.jpg?t=1610576424"
},
{
"id": 2,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_baa02e979cd3852e3c4182afcd603ab64e3502f9.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_baa02e979cd3852e3c4182afcd603ab64e3502f9.1920x1080.jpg?t=1610576424"
},
{
"id": 3,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_ffe584c163a2b16e9c1b733b1c8e2ba669fb1204.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_ffe584c163a2b16e9c1b733b1c8e2ba669fb1204.1920x1080.jpg?t=1610576424"
},
{
"id": 4,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_d87c102d028d545c877363166c9d8377014f0c23.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_d87c102d028d545c877363166c9d8377014f0c23.1920x1080.jpg?t=1610576424"
},
{
"id": 5,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_9d0735a5fbe523fd39f2c69c047019843c326cea.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_9d0735a5fbe523fd39f2c69c047019843c326cea.1920x1080.jpg?t=1610576424"
},
{
"id": 6,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_9d889bec419cf38910ccf72dd80f9260227408ee.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_9d889bec419cf38910ccf72dd80f9260227408ee.1920x1080.jpg?t=1610576424"
},
{
"id": 7,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_ccc4ce6edd4c454b6ce7b0757e633b63aa93921d.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_ccc4ce6edd4c454b6ce7b0757e633b63aa93921d.1920x1080.jpg?t=1610576424"
},
{
"id": 8,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_9db552fd461722f1569e3292d8f2ea654c8ffdef.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_9db552fd461722f1569e3292d8f2ea654c8ffdef.1920x1080.jpg?t=1610576424"
},
{
"id": 9,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_74c1a0264ceaf57e5fb51d978205045223b48a18.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_74c1a0264ceaf57e5fb51d978205045223b48a18.1920x1080.jpg?t=1610576424"
},
{
"id": 10,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_7eaa83e44f5218a7bf5f88a0c750e36052e31d7d.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_7eaa83e44f5218a7bf5f88a0c750e36052e31d7d.1920x1080.jpg?t=1610576424"
},
{
"id": 11,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_68007896ad6071b7062bac530c481e097105efc0.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_68007896ad6071b7062bac530c481e097105efc0.1920x1080.jpg?t=1610576424"
},
{
"id": 12,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_2fcee01bace72bc47a2ad0ba82620588239e93df.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_2fcee01bace72bc47a2ad0ba82620588239e93df.1920x1080.jpg?t=1610576424"
},
{
"id": 13,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_f5875f8de419a3d5133ae7245b8296db2c027dd8.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_f5875f8de419a3d5133ae7245b8296db2c027dd8.1920x1080.jpg?t=1610576424"
},
{
"id": 14,
"path_thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_36f82c71ee2180159b060b155bf3d06dd8167327.600x338.jpg?t=1610576424",
"path_full": "https://steamcdn-a.akamaihd.net/steam/apps/730/ss_36f82c71ee2180159b060b155bf3d06dd8167327.1920x1080.jpg?t=1610576424"
}
],
"movies": [
{
"id": 81958,
"name": "CS:GO Trailer Long",
"thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/81958/movie.293x165.jpg?t=1554409259",
"webm": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/81958/movie480.webm?t=1554409259",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/81958/movie_max.webm?t=1554409259"
},
"mp4": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/81958/movie480.mp4?t=1554409259",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/81958/movie_max.mp4?t=1554409259"
},
"highlight": true
},
{
"id": 2028283,
"name": "CS: GO Pro Tip Series: nEiLZiNHo",
"thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/2028283/movie.293x165.jpg?t=1554409264",
"webm": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028283/movie480.webm?t=1554409264",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028283/movie_max.webm?t=1554409264"
},
"mp4": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028283/movie480.mp4?t=1554409264",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028283/movie_max.mp4?t=1554409264"
},
"highlight": false
},
{
"id": 2028284,
"name": "CS: GO Pro Tip Series: ruggah",
"thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/2028284/movie.293x165.jpg?t=1554409270",
"webm": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028284/movie480.webm?t=1554409270",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028284/movie_max.webm?t=1554409270"
},
"mp4": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028284/movie480.mp4?t=1554409270",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028284/movie_max.mp4?t=1554409270"
},
"highlight": false
},
{
"id": 2028286,
"name": "CS: GO Pro Tip Series: AZK",
"thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/2028286/movie.293x165.jpg?t=1554409276",
"webm": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028286/movie480.webm?t=1554409276",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028286/movie_max.webm?t=1554409276"
},
"mp4": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028286/movie480.mp4?t=1554409276",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028286/movie_max.mp4?t=1554409276"
},
"highlight": false
},
{
"id": 2028287,
"name": "CS: GO Pro Tip Series: sapphiRe",
"thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/2028287/movie.293x165.jpg?t=1554409281",
"webm": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028287/movie480.webm?t=1554409281",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028287/movie_max.webm?t=1554409281"
},
"mp4": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028287/movie480.mp4?t=1554409281",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028287/movie_max.mp4?t=1554409281"
},
"highlight": false
},
{
"id": 2028288,
"name": "CS: GO Pro Tip Series: TM",
"thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/2028288/movie.293x165.jpg?t=1554409287",
"webm": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028288/movie480.webm?t=1554409287",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028288/movie_max.webm?t=1554409287"
},
"mp4": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028288/movie480.mp4?t=1554409287",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028288/movie_max.mp4?t=1554409287"
},
"highlight": false
},
{
"id": 2028289,
"name": "CS: GO Pro Tip Series: Semphis",
"thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/2028289/movie.jpg?t=1554409293",
"webm": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028289/movie480.webm?t=1554409293",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028289/movie_max.webm?t=1554409293"
},
"mp4": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028289/movie480.mp4?t=1554409293",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028289/movie_max.mp4?t=1554409293"
},
"highlight": false
},
{
"id": 2028285,
"name": "CS: GO Pro Tip Series: Fifflaren",
"thumbnail": "https://steamcdn-a.akamaihd.net/steam/apps/2028285/movie.293x165.jpg?t=1554409299",
"webm": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028285/movie480.webm?t=1554409299",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028285/movie_max.webm?t=1554409299"
},
"mp4": {
"480": "http://steamcdn-a.akamaihd.net/steam/apps/2028285/movie480.mp4?t=1554409299",
"max": "http://steamcdn-a.akamaihd.net/steam/apps/2028285/movie_max.mp4?t=1554409299"
},
"highlight": false
}
],
"recommendations": {
"total": 2975748
},
"achievements": {
"total": 167,
"highlighted": [
{
"name": "Someone Set Up Us The Bomb",
"path": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/9f60ea3c56b4ab248ab598bbd62568b953116301.jpg"
},
{
"name": "Boomala Boomala",
"path": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/325ccbd68e599083c1597fd90dc6d4265d1ca3b4.jpg"
},
{
"name": "The Hurt Blocker",
"path": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/9b8627953feca51a56f0c2ac871493c8634a1c07.jpg"
},
{
"name": "Body Bagger",
"path": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/b11ef0453168cd3d10684e184004f71dcc0faa82.jpg"
},
{
"name": "Corpseman",
"path": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/60d83a42df84fa5d84910af681370579e3bb16bf.jpg"
},
{
"name": "God of War",
"path": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/2c2bb56a4f7376b53eeaf8e6d84044460b0d1cf2.jpg"
},
{
"name": "Second to None",
"path": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/986a53e24114699cb1f230f52b55b27e0de28ecf.jpg"
},
{
"name": "Counter-Counter-Terrorist",
"path": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/c09cb3fe34841fd1000a48c3b7825c4fde026188.jpg"
},
{
"name": "Rite of First Defusal",
"path": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/b2027dac5a9883f0f145e78a33e531a58944f3ec.jpg"
},
{
"name": "Short Fuse",
"path": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/648550738f4845f12aa686a1b4ee8c4a51ec2348.jpg"
}
]
},
"release_date": {
"coming_soon": false,
"date": "21 Aug, 2012"
},
"support_info": {
"url": "",
"email": ""
},
"background": "https://steamcdn-a.akamaihd.net/steam/apps/730/page_bg_generated_v6b.jpg?t=1610576424",
"content_descriptors": {
"ids": [
2,
5
],
"notes": "Includes intense violence and blood."
}
}
}
}
"""
try: # proberen appid geforceerd in een integer om te zetten
appid = int(appid)
except ValueError: # als het niet mogelijk is False returnen
return False
# Steam api opvragen voor appid
r = requests.get('http://store.steampowered.com/api/appdetails', params={'appids': appid})
if r.status_code != 200: # als de request niet is gelukt
return False # False returnen
return r.json() # return de gekregen json zonder check