Ajustei pra trazer os "SCOUTS", inclui tbm as novas DS e PI que o @edsonbr citou, segue o código e planilha:
Sub ExtrairJson()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
With CreateObject("WinHttp.WinHttpRequest.5.1")
.Open "GET", "https://api.cartolafc.globo.com/atletas/mercado", False
.send: .WaitForResponse 10
txtSite = .responsetext
End With
Dim jsonObject As Object
Set jsonObject = JsonConverter.ParseJson(txtSite)
With Planilha1
i = 3
For Each item In jsonObject("atletas")
.Cells(i, "A") = item("nome")
.Cells(i, "B") = item("slug")
.Cells(i, "C") = item("apelido")
.Cells(i, "D") = item("foto")
.Cells(i, "E") = item("atleta_id")
.Cells(i, "F") = item("rodada_id")
.Cells(i, "G") = item("clube_id")
.Cells(i, "H") = item("posicao_id")
.Cells(i, "I") = item("status_id")
.Cells(i, "J") = item("pontos_num")
.Cells(i, "K") = item("preco_num")
.Cells(i, "L") = item("variacao_num")
.Cells(i, "M") = item("media_num")
.Cells(i, "N") = item("jogos_num")
.Cells(i, "O") = item("scout")("RB")
.Cells(i, "P") = item("scout")("G")
.Cells(i, "Q") = item("scout")("A")
.Cells(i, "R") = item("scout")("SG")
.Cells(i, "S") = item("scout")("FS")
.Cells(i, "T") = item("scout")("FF")
.Cells(i, "U") = item("scout")("FD")
.Cells(i, "V") = item("scout")("FT")
.Cells(i, "W") = item("scout")("DD")
.Cells(i, "X") = item("scout")("DP")
.Cells(i, "Y") = item("scout")("GC")
.Cells(i, "Z") = item("scout")("CV")
.Cells(i, "AA") = item("scout")("CA")
.Cells(i, "AB") = item("scout")("PP")
.Cells(i, "AC") = item("scout")("GS")
.Cells(i, "AD") = item("scout")("FC")
.Cells(i, "AE") = item("scout")("I")
.Cells(i, "AF") = item("scout")("PE")
.Cells(i, "AG") = item("scout")("DS")
.Cells(i, "AH") = item("scout")("PI")
i = i + 1
Next
End With
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
MsgBox "Extração Efetuada!", vbInformation, "Aviso."
End Sub
Postado : 17/09/2020 7:31 pm