ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

How to Scrape SofaScore for Football Data

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ส.ค. 2023
  • Github with code: github.com/mck...
    Get Free Sports Data Forever by Building Your Own Web Scraping Pipeline: mckay-s-site.t...
    Subscribe to my newsletter talking about data + sports : mckayjohns.sub...
    Follow me on Twitter: / mckayjohns
    Join the Football Analytics Discord: / discord

ความคิดเห็น • 85

  • @Goonerilla
    @Goonerilla ปีที่แล้ว +19

    Awesome video. Is there a possibility for a part 2 where you show how to recreate the shot map in Python?

    • @mobhamjee786
      @mobhamjee786 6 หลายเดือนก่อน

      Yea would like to see that

  • @RelaxingNature6
    @RelaxingNature6 7 หลายเดือนก่อน +2

    I am very happy Johns about your vedeos you are doing for us , to learn more about how yo scrape Football Data from websites , but my question is , how we can organize the Data as Table not like that ??

  • @dmousouroulis
    @dmousouroulis 6 หลายเดือนก่อน

    Thank you McKay, that was quick and easy to follow! Appreciate the great content

    • @McKayJohns
      @McKayJohns  6 หลายเดือนก่อน +1

      Glad it was helpful!

  • @vaggkkk5483
    @vaggkkk5483 5 หลายเดือนก่อน +2

    I do all the steps but get 403 response. Has sofascore closed access or i am doing something wrong

    • @McKayJohns
      @McKayJohns  5 หลายเดือนก่อน

      Hm the only people I know that have gotten a 403 have been using google collab is that your case?

    • @danads4988
      @danads4988 4 หลายเดือนก่อน

      ​@@McKayJohns Same problem and I use a jupyter notebook. Please can you give an up dated tutorial on how to bypass the 403 on sofascore? Thanks in advance.

  • @santiagonieto5602
    @santiagonieto5602 11 หลายเดือนก่อน +5

    Hello McKay Johns, great content. I have a question, is it possible to scrape the Match Momentum of the match as well? Thank you very much!

  • @mikearchman
    @mikearchman 11 หลายเดือนก่อน +3

    Hello,, this was pretty helpful. I've been trying to get some data from SS using selenium, but every now and then something changes on the pages,, have to keep changing paths and selectors,, just pure pain,,, this is much pretty neat and easy to maintain,, thanks

  • @atlasgunther8947
    @atlasgunther8947 5 หลายเดือนก่อน +1

    Can you do a detailed video to scrape sofascore's historical score data, i currently have to scroll manually to scrape it. Thank you.

  • @bernardooliveira7184
    @bernardooliveira7184 23 วันที่ผ่านมา

    Hi! Great video!
    However, I have a question: wouldn't it be easier to use the SofaScore API?

  • @FiorenzoMaccarone
    @FiorenzoMaccarone 6 หลายเดือนก่อน +1

    Hi, is it possible to extract all the Serie A players and the statistics for each player?
    Are there too many requests and does it block?
    In the video I see that you take the URL from Fetch but can it be done automatically to take the XG of each player for example? Thank you.

  • @Monsalvo888
    @Monsalvo888 ปีที่แล้ว

    Really useful video. thanks for sharing!

  • @OkenTheReal
    @OkenTheReal 3 หลายเดือนก่อน +1

    Hi, thank you for your video, I recently saw that sofascore integrated "honeytoken" mechanism into their apis, which means that they randomly send you fake data instead of blocking you. Do you know how to solve this?

    • @McKayJohns
      @McKayJohns  3 หลายเดือนก่อน +3

      Yeah currently working on a updated video. Probably out sometime next week

  • @vinothnk5591
    @vinothnk5591 ปีที่แล้ว +1

    thank you very much for this video!

  • @adityakhare8942
    @adityakhare8942 ปีที่แล้ว

    Thank you so much for this great video!! Would be Very Helpful❤🙏

  • @user-xp3sq9kr4q
    @user-xp3sq9kr4q 2 หลายเดือนก่อน

    this only work for live events? the external api requests

  • @davidrohan6098
    @davidrohan6098 11 หลายเดือนก่อน +1

    Would it be possible to scrape a player's shotmap for an entire season

    • @McKayJohns
      @McKayJohns  11 หลายเดือนก่อน +1

      Yes totally possible

  • @o.gustavoneves
    @o.gustavoneves 4 หลายเดือนก่อน

    Hello, my friend. I Nedd a Help
    With the shotmap endpoint, for each request I make, the api returns different data to me even if the game has already finished. Has this ever happened?

  • @Madib21
    @Madib21 6 หลายเดือนก่อน

    Oh god where on earth did you get all this from..amazing work. Have one question. Do you work as an analyst anywhere in the industry?

    • @McKayJohns
      @McKayJohns  6 หลายเดือนก่อน +2

      Hahah I work as a data engineer for a startup so no I don’t work in sports just have been doing it as a hobby and to learn new skills for a while now

  • @sailithish4579
    @sailithish4579 5 หลายเดือนก่อน

    Hey bro I have an issue when I’m trying to scrape data for statistics it’s getting restricted to one league can you help with me how I can tackle this issue and make it so I can scrape statistics of players from all leagues

  • @nadirstivan6088
    @nadirstivan6088 ปีที่แล้ว

    Just by chance, I saw you in your videos explaining a program between two teams, Fulham against Liverpool, for more than two years... and today, you also explain another program. Can you explain more... Can it help me to have good expectations?I play satellites.... especially football

  • @agdaltarek
    @agdaltarek 8 หลายเดือนก่อน

    i'm finding a hard time plotting the shots on target locations, i guess it's the 'draw' column that gives the coordinates but don't know what goal dimension they have set. do you have any ideas ?

  • @ElGringoCa
    @ElGringoCa 11 หลายเดือนก่อน +1

    Hey is it possible to scrape the webdata to google sheets? I want to keep track of the player stats thats provided by SofaScore

    • @McKayJohns
      @McKayJohns  11 หลายเดือนก่อน +2

      Yeah you can either save them manually, or if you want to play around with googles sheets api then you could insert it directly

  • @joeosborne980
    @joeosborne980 ปีที่แล้ว

    New backdrop is clean

    • @McKayJohns
      @McKayJohns  ปีที่แล้ว +2

      The pikachu lights up

  • @myanmarfootballanalysis
    @myanmarfootballanalysis ปีที่แล้ว +1

    This really helps me.

  • @LanusStats
    @LanusStats ปีที่แล้ว

    Amazing as usual!

  • @constructionisdangerous
    @constructionisdangerous 5 หลายเดือนก่อน

    Look man is it possible to figure something out where I can find out stats for team in the last 5.games I can't find websites that do this

  • @nadirstivan6088
    @nadirstivan6088 ปีที่แล้ว

    I want to ask about the previous program that I explained more than two years ago, which I did, I think between Fulham against Liverpool, how can it help me get good expectations? Is this possible?

  • @ryanfeasey3725
    @ryanfeasey3725 ปีที่แล้ว +2

    Anyway to turn the shot locations to a Data Frame?

    • @McKayJohns
      @McKayJohns  ปีที่แล้ว +1

      you should be able to do pd.DataFrame(shots) and it will load

    • @ryanfeasey3725
      @ryanfeasey3725 ปีที่แล้ว

      It works but it is still in a weird format any idea on how to get proper coloumns and rows.@@McKayJohns

    • @McKayJohns
      @McKayJohns  ปีที่แล้ว +1

      @@ryanfeasey3725 you might have to unpack each individual row. I would look into maybe something like this: stackoverflow.com/questions/61847791/how-to-explode-nested-json-in-pandas-as-rows or try and ask chat gpt haha

    • @ryanfeasey3725
      @ryanfeasey3725 ปีที่แล้ว

      @@McKayJohnsthanks

  • @uttaranbera8573
    @uttaranbera8573 ปีที่แล้ว +1

    Hi, Just wondering, which do you feel is the best website to scrape defensive actions?

    • @McKayJohns
      @McKayJohns  ปีที่แล้ว +1

      probably look at sofascore to see if it has anything or maybe fbref. If not try whoscored

  • @joaopompeo
    @joaopompeo 9 หลายเดือนก่อน

    Hey Mckay, is there anyway I can put on together all the data from where a player shot and his mean throughout an entire season? Was thinking as well if there's any way for me to enter in contact with you to see if you can do one for me and how much you would charge for you to do so, thanks a lot in advance!

  • @sigfigronath
    @sigfigronath 3 หลายเดือนก่อน

    hey Mckay, can we code using visual studio as well and not stick to jupiter

    • @McKayJohns
      @McKayJohns  3 หลายเดือนก่อน

      Ya I prefer Jupyter for tutorials just cause it’s easy to use but you can use whatever

  • @marcelotrinkard2255
    @marcelotrinkard2255 3 หลายเดือนก่อน

    After yesterday’s 503 errors, the API queries are working again today. I’ve been making some attempts to consume various APIs as you explain in the video, and I’ve noticed that the returned data is inconsistent, even without changing anything in the headers or the query URL. The data changes, and logically, these are queries for data that isn’t changing. For example, when I check the league statistics, one query returns 567 accumulated goals, and the next one returns 1059 accumulated goals. It’s as if it’s providing fake information. Is this a defense mechanism of Sofascore? Have you had the chance to verify the reliability of the returned data?

    • @McKayJohns
      @McKayJohns  3 หลายเดือนก่อน +3

      Yeah I noticed this and am remaking the video to show how to get around it

    • @vascosilva9582
      @vascosilva9582 3 หลายเดือนก่อน

      I'm having the same issue, using this to get info on a team's next match - for each request (using the API), the parsed data shows a completely different timestamp pertaining to the start time, consistenly inaccurate

  • @vartanpashayan297
    @vartanpashayan297 หลายเดือนก่อน

    Do you have to write the headers if you get a 200 code on the response the first time you try it

    • @McKayJohns
      @McKayJohns  หลายเดือนก่อน

      Technically no, headers just help for authenticity of the request

  • @Pavle_Savkovic
    @Pavle_Savkovic 4 หลายเดือนก่อน

    Great video thanks a lot!!!

  • @alexandredorville317
    @alexandredorville317 3 หลายเดือนก่อน

    Hi !!
    Thank you for the video! I've been using this for a while now, and I really find it excellent.
    Since yesterday, I've encountered an issue: an HTTP 503 Service Unavailable error appears. Have you experienced the same issue? Do you know if this is temporary or if they have implemented a block on the API calls?
    Thank you in advance for your help.

    • @McKayJohns
      @McKayJohns  3 หลายเดือนก่อน

      Yes I noticed it today. I need to remake this video with the new method I founs

    • @alexandredorville317
      @alexandredorville317 3 หลายเดือนก่อน

      @@McKayJohns That would be great! Thank you in advance.

  • @macaveliypm7913
    @macaveliypm7913 หลายเดือนก่อน

    Hello bro, can you scrape data between date range? like from 2023-02-01 to 2022-08-01

  • @pankajjadhav3969
    @pankajjadhav3969 10 หลายเดือนก่อน

    Hey mckay, thanks for doing these tutorials. Just one question : how do i export it to a CSV?

    • @McKayJohns
      @McKayJohns  10 หลายเดือนก่อน +1

      if you load it into a pandas dataframe, and your dataframe variable is called df
      you can do
      df.to_csv('location you want to export.csv')

    • @pankajjadhav3969
      @pankajjadhav3969 10 หลายเดือนก่อน

      @@McKayJohns Thanks man

  • @user-nl4gl7gf2h
    @user-nl4gl7gf2h 7 หลายเดือนก่อน

    Hey my friend, can you create a football predictions script for me?

  • @bakhodiryakubov3981
    @bakhodiryakubov3981 11 หลายเดือนก่อน

    @McKayJohns, do you use playerCoordinates or draw coordinates for the shotmap? I followed your tutorial for shotmaps using data scraped by following this video but it's not aligned, goalscorer is somewhere in the middle of the pitch :)

  • @TLFootball123
    @TLFootball123 ปีที่แล้ว

    Good tutorial as always, any chance you can do one on Zones of control? Thanks

    • @McKayJohns
      @McKayJohns  ปีที่แล้ว

      I can take a look 👍

    • @TLFootball123
      @TLFootball123 ปีที่แล้ว

      @@McKayJohns Thanks!

    • @TLFootball123
      @TLFootball123 ปีที่แล้ว

      If you see this, is it possible to convert the JSON into CSV and if so how do you do it@@McKayJohns

    • @McKayJohns
      @McKayJohns  ปีที่แล้ว

      @@TLFootball123 Ya you can put the shots in a pandas dataframe... pd.DataFrame(shots) like that then export it as a csv if you wish

  • @Thibsalm
    @Thibsalm 9 หลายเดือนก่อน

    Great video !
    Did you know how to scrape MLB results with all innings scores from Sofascore ?

    • @McKayJohns
      @McKayJohns  8 หลายเดือนก่อน +1

      You should be able to. I've never done it but process should be roughly the same

    • @Thibsalm
      @Thibsalm 8 หลายเดือนก่อน

      I tried to do it without succeded... could you do a quick video please ?

  • @everflores9484
    @everflores9484 10 หลายเดือนก่อน

    I have the intuition that if i wanted to scrape every match of the PL I'd have to create a list of the 380 matches, but I'm sure there's an easier way. Same with say, ManUtd. Sofascore doesn't make it very easy to scale I feel

    • @McKayJohns
      @McKayJohns  10 หลายเดือนก่อน +1

      Yeah it’s tough but you should be able to programmatically make a list of match urls

  • @scoreadvise_official
    @scoreadvise_official ปีที่แล้ว

    Very nice!

  • @Muiloko2000
    @Muiloko2000 ปีที่แล้ว

    You're the man

  • @maniac_q
    @maniac_q 2 หลายเดือนก่อน

    Make a tutorial on how to get trough a chat ban on sofascore please

    • @timokorpershoek1893
      @timokorpershoek1893 2 หลายเดือนก่อน

      chat ban? what do you mean?

    • @maniac_q
      @maniac_q 2 หลายเดือนก่อน

      @@timokorpershoek1893 my messages don't show up in the chat

  • @victorpaulinodesousa8400
    @victorpaulinodesousa8400 ปีที่แล้ว

    is there a option for R?

    • @McKayJohns
      @McKayJohns  ปีที่แล้ว

      I don't have the code for R, but the concept is the same

  • @nadirstivan6088
    @nadirstivan6088 ปีที่แล้ว

    Hello, I would like to ask, is it possible, is it possible, is it possible, for example Hello, I would like to ask, can such a program help me, such as the way you choose the results of football matches, especially since I play or any program you talked about I play in the field of sports, note, frankly, can you help me what you play in it and how it is

    • @Eizengoldt
      @Eizengoldt 8 หลายเดือนก่อน +1

      What’s wrong with you?

  • @akawonde4044
    @akawonde4044 3 หลายเดือนก่อน

    I have this thing

  • @SeifAjax04
    @SeifAjax04 ปีที่แล้ว

    response.status_code is 403
    While I am using the latest version of Google Chrome
    and i followed the instructions exactly :(

    • @McKayJohns
      @McKayJohns  ปีที่แล้ว +1

      Hm what does your code look like

    • @SeifAjax04
      @SeifAjax04 ปีที่แล้ว

      @@McKayJohns hi bro First, I want to thank you for your great content,, I was using DataLore, but when I used jupyter It worked well, but I haven't finished the video yet, and I still lived your exciting experience, But I want to send you an email to inquire about something. Do you have time for that?

  • @poeticscales
    @poeticscales ปีที่แล้ว

    Hi Mckay, first of all I've really learnt a lot from your videos thanks for all of your informative videos. I do post Football Data Analytical & tactical videos on my channel really would like to have a chat with you so that I can tell you more about my content, if possible
    I'm from India so if anyone is planning to visit my channel there will be language barrier 😅