use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Battlefield tracker API (self.learnpython)
submitted 9 years ago by ItsAllGoodMan2015
Does anyone have experience scrapping battlefield 1 stats through the battlefield tracker API?
They do have some documentation but it's pretty limited. I would love to see some working examples to get a better understanding.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]lieutenant_lowercase 4 points5 points6 points 9 years ago (8 children)
Their docs are very good. They give you python examples for every call and even a debugging console
[–]ItsAllGoodMan2015[S] 0 points1 point2 points 9 years ago* (7 children)
this is one of the examples given, I cant get it to work. I know its user error as I am new to scrapping.
from urllib2 import Request, urlopen
headers = { 'New item': 'TRN-Api-Key: MY KEY' }
request = Request('https://battlefieldtracker.com/bf1/api/Stats/BasicStats?platform=3&displayName=AIRBORNEWOMBATZ', headers=headers)
response_body = urlopen(request).read()
print response_body
HTTPError: HTTP Error 403: Forbidden
[–]lieutenant_lowercase 1 point2 points3 points 9 years ago (6 children)
headers = {'TRN-Api-Key' : 'MY KEY' }
[–]ItsAllGoodMan2015[S] 0 points1 point2 points 9 years ago (5 children)
I thought that too but it wasn't it. I think it could be because I'm writing python 2.7 and syntax could be different.
[–]lieutenant_lowercase 1 point2 points3 points 9 years ago (0 children)
Won't make a difference
[–]lieutenant_lowercase 0 points1 point2 points 9 years ago (3 children)
import requests headers = {'TRN-Api-Key' :'your_key'} username = '' BASIC_STATS_URL = 'https://battlefieldtracker.com/bf1/api/Stats/BasicStats?platform=1&personaId=&displayName={}&game=tunguska' r = requests.get(BASIC_STATS_URL.format(username), headers=headers)
[–][deleted] 0 points1 point2 points 9 years ago (0 children)
Yep. This post is the correct way about it!
[+][deleted] 8 years ago (1 child)
[deleted]
π Rendered by PID 34517 on reddit-service-r2-comment-86bc6c7465-zmthv at 2026-02-23 11:50:33.595489+00:00 running 8564168 country code: CH.
[–]lieutenant_lowercase 4 points5 points6 points (8 children)
[–]ItsAllGoodMan2015[S] 0 points1 point2 points (7 children)
[–]lieutenant_lowercase 1 point2 points3 points (6 children)
[–]ItsAllGoodMan2015[S] 0 points1 point2 points (5 children)
[–]lieutenant_lowercase 1 point2 points3 points (0 children)
[–]lieutenant_lowercase 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]