#Schiphol Flight API

1 messages · Page 1 of 1 (latest)

midnight trout
#

You can use this for departure boards or whatever you heart desires. I'm not sure if you can use it for other airports too, but it shouldn't be hard to change it. !getdata is a command you are able to change too.

You can use this website for more information
https://www.schiphol.nl/en/developer-center/ (Note, creating an account is free and fast! There are several plans but the "City Hopper" plan is free and is sufficient.)

If you want to do something else with it, please ask me for any help. Don't say it's yours. Normally I don't share things like this, but because I have help from people I am in a good mood. So be happy. Give me credit if you're going to use this for anything.
I don't give resell permissions or anything, so don't sell it as a product.

-- Server Script
local http = game:GetService('HttpService')

local url = "https://api.schiphol.nl/public-flights/flights?includedelays=false&page=0&sort=%2BscheduleTime"
local headers = { -- All this needs to be included in order to function properly
    ["Accept"]= "application/json",
    ["app-id"]= "API ID HERE",
    ["app-key"]= "API KEY HERE",
    ["ResourceVersion"]= "v4" -- Needs to be V3 or higher in order to function properly.
}

game:GetService("Players").PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(message)
        if message:lower() == "!getdata" then
            local response = http:RequestAsync({
                Url = url,
                Method = "GET",
                Headers = headers
            })

            --print(response.Body) -- Print the raw response body incase you need it.

            local success, responseData = pcall(function()
                return http:JSONDecode(response.Body)
            end)

            if success then
                print(responseData)
            else
                print("Error parsing JSON:", responseData) -- This will print the parsing error
            end
        end
    end)
end)
cosmic spire
#

so uh it did work?

midnight trout
#

Yes

swift basalt
#

um what does it do?

cosmic spire
swift basalt
#

ummm

midnight trout
keen ermine
#

Probably

midnight trout
#

And I'm pretty sure there are other airport API's out there that provide this type of information.

cosmic spire