<filename>vroomrr-api/flask/rdw.py
import requests


class RDW:
    SERVER = 'https://opendata.rdw.nl/'
    RESOURCE_VOERTUIGEN = 'resource/m9d7-ebf2.json'
    RESOURCE_FUEL = 'resource/8ys7-d773.json'

    def getVehicle(self, kenteken):
        # Filters - and makes all letter uppercase for RDW API
        r = requests.get(url=self.SERVER + self.RESOURCE_VOERTUIGEN + '?kenteken=' + kenteken.upper().replace('-', ''))
        try:
            return r.json()[0]
        except IndexError:
            return False

    def getVehicleFuel(self, kenteken):
        # Filters - and makes all letter uppercase for RDW API
        r = requests.get(url=self.SERVER + self.RESOURCE_FUEL + '?kenteken=' + kenteken.upper().replace('-', ''))
        try:
            return r.json()[0]
        except IndexError:
            return False

<filename>vroomrr-api/flask/rdw.py
import requests


class RDW:
    SERVER = 'https://opendata.rdw.nl/'
    RESOURCE_VOERTUIGEN = 'resource/m9d7-ebf2.json'
    RESOURCE_FUEL = 'resource/8ys7-d773.json'

    def getVehicle(self, kenteken):
        # Filters - and makes all letter uppercase for RDW API
        r = requests.get(url=self.SERVER + self.RESOURCE_VOERTUIGEN + '?kenteken=' + kenteken.upper().replace('-', ''))
        try:
            return r.json()[0]
        except IndexError:
            return False

    def getVehicleFuel(self, kenteken):
        # Filters - and makes all letter uppercase for RDW API
        r = requests.get(url=self.SERVER + self.RESOURCE_FUEL + '?kenteken=' + kenteken.upper().replace('-', ''))
        try:
            return r.json()[0]
        except IndexError:
            return False

# Filters - and makes all letter uppercase for RDW API # Filters - and makes all letter uppercase for RDW API