Bonjour à tous
J essai de comprendre l’utilisation de « requsets »
ici par exemple j’arrive à récupérer le l’élément « marketType': '1/N/2' »
mais comment faire pour récupérer tout les autres éléments du type « marketType': » qui sont juste en dessous.
ici par exemple les elements en gras
'Mi-Temps'
'Handicap [0:1] (Temps Réglementaire)
Merci d'avance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 import requests import json response = requests.get("https://www.pointdevente.parionssport.fdj.fr/api/1n2/offre?sport=601600") r = json.loads(response.text) print(r) for marketType in r : print(marketType['marketType'])
[{'eventId': '811740', 'marketId': '10520197', 'marketPos': 1, 'hasCombiBonus': False, 'sportId': '601600', 'index': '949', 'marketType': '1/N/2', 'marketTypeGroup': '1/N/2', 'marketTypeId': 1, 'end': '2021-10-11T19:55:00+02:00', 'label': 'Tel. Ostende-Strasbourg', 'eventType': 'GameEvent', 'competition': 'ChampionsLeague', 'competitionId': '47033', 'nbMarkets': 2, 'outcomes': [{'label': '1', 'pos': '1', 'cote': '1,69', 'trend': '0', 'winner': False, 'status': 2}, {'label': 'N', 'pos': '2', 'cote': '12,00', 'trend': '0', 'winner': False, 'status': 2}, {'label': '2', 'pos': '3', 'cote': '2,05', 'trend': '0', 'winner': False, 'status': 2}], 'betTypeExclusions': '0000000000000000000000000000000000000000000000000', 'authorizationExclusion': '11010000', 'formules': [{'eventId': '811740', 'index': '950', 'sportId': '601600', 'marketType': 'Handicap [0:1] (Temps Réglementaire)', 'marketTypeGroup': 'Handicap', 'marketTypeId': 3, 'marketId': '10731415', 'marketPos': 2, 'label': 'Tel. Ostende-Strasbourg', 'competition': 'ChampionsLeague', 'competitionId': '47033', 'end': '2021-10-11T19:55:00+02:00', 'betTypeExclusions': '0000000000000000000000000000000000000000000000000', 'authorizationExclusion': '11010000', 'outcomes': [{'label': '1', 'pos': '1', 'cote': '1,72', 'trend': '0', 'winner': False, 'status': 2}, {'label': 'N', 'pos': '2', 'cote': '29,00', 'trend': '0', 'winner': False, 'status': 2}, {'label': '2', 'pos': '3', 'cote': '1,77', 'trend': '0', 'winner': False, 'status': 2}]}, {'eventId': '811740', 'index': '958', 'sportId': '601600', 'marketType': 'Mi-Temps', 'marketTypeGroup': 'Mi-Temps', 'marketTypeId': 2, 'marketId': '10731396', 'marketPos': 3, 'label': 'Tel. Ostende-Strasbourg', 'competition': 'ChampionsLeague', 'competitionId': '47033', 'end': '2021-10-11T19:55:00+02:00', 'betTypeExclusions': '0000000000000000000000000000000000000000000000000', 'authorizationExclusion': '11010000', 'outcomes': [{'label': '1', 'pos': '1', 'cote': '1,68', 'trend': '0', 'winner': False, 'status': 2}, {'label': 'N', 'pos': '2', 'cote': '16,00', 'trend': '0', 'winner': False, 'status': 2}, {'label': '2', 'pos': '3', 'cote': '1,92', 'trend': '0', 'winner': False, 'status': 2}]}], 'count': 1, 'hasLotoFoot': False, 'urlStats': 'https://s5.sir.sportradar.com/parionssportpointdevente/fr/match/m2809114'}, {'eventId': '815760', 'marketId': '10681760', 'marketPos': 1, 'hasCombiBonus': False, 'sportId': '601600', 'index': '311', 'marketType': '1/N/2', 'marketTypeGroup': '1/N/2', 'marketTypeId': 1, 'end': '2021-10-20T01:25:00+02:00', 'label': 'MIL Bucks-BKN Nets', 'eventType': 'GameEvent', 'competition': 'NBA', 'competitionId': '46437', 'nbMarkets': 0, 'outcomes': [{'label': '1', 'pos': '1', 'cote': '2,05', 'trend': '0', 'winner': False, 'status': 2}, {'label': 'N', 'pos': '2', 'cote': '14,50', 'trend': '0', 'winner': False, 'status': 2}, {'label': '2', 'pos': '3', 'cote': '1,95', 'trend': '0', 'winner': False, 'status': 2}], 'betTypeExclusions': '0000000000000000000000000000000000000000000000000', 'authorizationExclusion': '11010000', 'formules': None, 'count': 1, 'hasLotoFoot': False, 'urlStats': 'https://s5.sir.sportradar.com/parionssportpointdevente/fr/match/m2813160'}, {'eventId': '815780', 'marketId': '10682038', 'marketPos': 1, 'hasCombiBonus': False, 'sportId': '601600', 'index': '312', 'marketType': '1/N/2', 'marketTypeGroup': '1/N/2', 'marketTypeId': 1, 'end': '2021-10-20T03:55:00+02:00', 'label': 'LA Lakers-GS Warriors', 'eventType': 'GameEvent', 'competition': 'NBA', 'competitionId': '46437', 'nbMarkets': 0, 'outcomes': [{'label': '1', 'pos': '1', 'cote': '1,55', 'trend': '0', 'winner': False, 'status': 2}, {'label': 'N', 'pos': '2', 'cote': '14,50', 'trend': '0', 'winner': False, 'status': 2}, {'label': '2', 'pos': '3', 'cote': '2,90', 'trend': '0', 'winner': False, 'status': 2}], 'betTypeExclusions': '0000000000000000000000000000000000000000000000000', 'authorizationExclusion': '11010000', 'formules': None, 'count': 1, 'hasLotoFoot': False, 'urlStats': 'https://s5.sir.sportradar.com/parionssportpointdevente/fr/match/m2813180'}, {'eventId': '815781', 'marketId': '10682039', 'marketPos': 1, 'hasCombiBonus': False, 'sportId': '601600', 'index': '314', 'marketType': '1/N/2', 'marketTypeGroup': '1/N/2', 'marketTypeId': 1, 'end': '2021-10-21T00:55:00+02:00', 'label': 'DET Pistons-CHI Bulls', 'eventType': 'GameEvent', 'competition': 'NBA', 'competitionId': '46437', 'nbMarkets': 0, 'outcomes': [{'label': '1', 'pos': '1', 'cote': '2,35', 'trend': '0', 'winner': False, 'status': 2}, {'label': 'N', 'pos': '2', 'cote': '14,50', 'trend': '0', 'winner': False, 'status': 2}, {'label': '2', 'pos': '3', 'cote': '1,75', 'trend': '0', 'winner': False, 'status': 2}], 'betTypeExclusions': '0000000000000000000000000000000000000000000000000', 'authorizationExclusion': '11010000', 'formules': None, 'count': 1, 'hasLotoFoot': False, 'urlStats': 'https://s5.sir.sportradar.com/parionssportpointdevente/fr/match/m2813181'}, {'eventId': '815766', 'marketId': '10682026', 'marketPos': 1, 'hasCombiBonus': False, 'sportId': '601600', 'index': '313', 'marketType': '1/N/2', 'marketTypeGroup': '1/N/2', 'marketTypeId': 1, 'end': '2021-10-21T00:55:00+02:00', 'label': 'CHA Hornets-IND Pacers', 'eventType': 'GameEvent', 'competition': 'NBA', 'competitionId': '46437', 'nbMarkets': 0, 'outcomes': [{'label': '1', 'pos': '1', 'cote': '1,82', 'trend': '0', 'winner': False, 'status': 2}, {'label': 'N', 'pos': '2', 'cote': '15,00', 'trend': '0', 'winner': False, 'status': 2}, {'label': '2', 'pos': '3', 'cote': '2,25', 'trend': '0', 'winner': False, 'status': 2}], 'betTypeExclusions': '0000000000000000000000000000000000000000000000000', 'authorizationExclusion': '11010000', 'formules': None, 'count': 1, 'hasLotoFoot': False, 'urlStats': 'https://s5.sir.sportradar.com/parionssportpointdevente/fr/match/m2813166'}, {'eventId': '815777', 'marketId': '10682035', 'marketPos': 1, 'hasCombiBonus': False, 'sportId': '601600', 'index': '316', 'marketType': '1/N/2', 'marketTypeGroup': '1/N/2', 'marketTypeId': 1, 'end': '2021-10-21T01:25:00+02:00', 'label': 'TOR Raptors-WAS Wizards', 'eventType': 'GameEvent', 'competition': 'NBA', 'competitionId': '46437', 'nbMarkets': 0, 'outcomes': [{'label': '1', 'pos': '1', 'cote': '1,70', 'trend': '0', 'winner': False, 'status': 2}, {'label': 'N', 'pos': '2', 'cote': '15,00', 'trend': '0', 'winner': False, 'status': 2}, {'label': '2', 'pos': '3', 'cote': '2,40', 'trend': '0', 'winner': False, 'status': 2}], 'betTypeExclusions': '0000000000000000000000000000000000000000000000000', 'authorizationExclusion': '11010000',
Partager