instafly-pro API: How To Use the API | RapidAPI

instafly-pro

FREEMIUM
By barkal
Updated 2 months ago
Visual Recognition
7.4/10
Popularity Score
2070ms
Latency
97%
Success Rate

instafly-pro API Overview

Instafly is snapping to packing API, the API consumes picture of a vacation spot in the form of an image URL, Instagram link, or an uploaded image, and retrieves ticket fares and location of the vacation spot, even an indoor picture will work. Use the /imageurltosearch to POST an image URL in the request body to receive flight & hotel details details, You will be able to optionally add to your request :

  • A TravelPayOuts Affiliate Marker instead of the default one, this will be included in the flight and hotel search links that the API will return.
  • A departure airport code for the flight search links, otherwise it defaults to YYC
  • A latitude and longitude of an origin point, the API will try to return flight search links originating from the closest major airports.

Sample requests and code snippets are available to add some magic to your applications. For more detailed info, head to https://rapidapi.com/barkal/api/instafly-pro/details, also visit our website for a quick visual demo https://www.instafly.me

Contact API Provider
star-blueRate

Instafly Pro Version
> Add somemagic to your websites and apps with this award winning API

Your users will pass you an instagram link, or an image of a mysterious vacation spot, and your application will call our API to return the name of the vacation spot, and the city and country. But not only that, we will also provide a link to compare flights to the nearest airports to that vacation spot, and a list of hotels in that area to choose from.

To test the api right away with NO code, make sure you're logged in to RapidAapi and head to :

https://rapidapi.com/barkal/api/instafly-pro (bookmark it now!)

Here's a sample response body that the API will return for the following image :

{
    "landmarkName": "Rijksmuseum",
    "lmLatitude": "52.370569",
    "lmLongitude": "4.89166259765625",
    "confidence": 80.4652,
    "destinationFlightInfoList": [
        {
            "airport": {
                "airportName": "Amsterdam Airport Schiphol",
                "airportCity": "Amsterdam",
                "airportCountry": "Netherlands",
                "airportIATAcode": "AMS",
                "airportLatitude": "52.308601",
                "airportLongitude": "4.76389",
                "zone": "Europe/Amsterdam"
            },
            "kmDistanceFromLandmark": 11.08,
            "mlDistanceFromLandmark": 6.89,
            "flightBookingLink": "http://bit.ly/2THrdrf",
            "hotelBookingLink": "http://bit.ly/2TKjAAn"
        }
    ]
}

Most of the elements above are self explantory, the confidence score details how confident the API was in recognizing the location of the image.

To call the API from your application, all you have to do is post this simple request:

unirest.post("https://instafly-pro.p.rapidapi.com/v1/imageurltosearch")
.header("X-RapidAPI-Key", "REPLACE_WITH_YOUR_RAPID_API_KEY")
.header("Content-Type", "application/json")
.send({"imageUrl":"REPLACE_WITH_A_URL_OF_AN_IMAGE_OF_A_VACATION_SPOT"})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});

Optionally you can add the departure airport code for example JFK (John F Keneddy Airport , New York)
or you can add a latitude and logitude of departure point, as seen below:

unirest.post("https://instafly-pro.p.rapidapi.com/v1/imageurltosearch")
.header("X-RapidAPI-Key", "REPLACE_WITH_YOUR_RAPID_API_KEY")
.header("Content-Type", "application/json")
.send({
"imageUrl":"REPLACE_WITH_A_URL_OF_AN_IMAGE_OF_A_VACATION_SPOT",
"originAirportIATACode": "AIRPORT_CODE"
"currentLatitude": 0.0,
"currentLongitude": 0.0,
"travelPayoutsMarker": "123456",
})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});

If no match found the departure location, the API will continue to default to "YYC", Calgary International airport as always.
If you pass all optional values, the departure airport and a latitude and longitude of a departure location, the airport code will override the departure location.

Another default (that will be soon changed) are the dates, the departure date is set to always be 2 weeks in the future, and the return date is set after 2 weeks after the departure date.

TravelPayouts Affiliates can pass in their marker in the request body as a string at "travelPayoutsMarker" and all the flights and hotel links that are returned will have their affiliate marker added to the search url.
To check if the shortened URL has your marker and not the default one, you can chaeck the URL at an online tool like Check Short URL .

The examples above is in Node.JS , but you can find code examples written in the most common Programming languages here https://rapidapi.com/barkal/api/instafly-pro

Because instafly API returns all the elements needed to request flight availability, it's easy to integrate with other booking systems


You can include your TravelPayOuts Affiliate Marker to add it to the returned links for flight and hotel search.

here are some test images, and yes, including indoor images :

Quick copy and paste examples :
Eiffel Tower, Paris
http://100kelioniu.lt/wp-content/uploads/2017/06/pexels-photo-338515-800x533.jpeg

Instagram link (Colosseum)
https://www.instagram.com/p/BvFc_M4Az_s

Vasa Mueseum, Stockholm
https://www.planetware.com/photos-large/S/sweden-stockholm-vasa.jpg (Indoors image)

Sagrada Familia, Barcelona
https://www.yessflats.com/ca/wp-content/uploads/sites/4/2018/01/sagrada_familia.jpg

Marienplatz, Munich
http://cdn.touropia.com/gfx/d/tourist-attractions-in-munich/marienplatz.jpg

Romer, Frankfurt
http://gtstravelservice.com/store/MT-Store/MT-Destinos-Frankfurt.jpg

Dancing House, Prague
https://www.planetware.com/photos-large/CZ/czech-republic-prague-dancing-house.jpg

Freedom Monument, Riga
http://soloscatto.blog.kataweb.it/files/2008/07/riga-31.jpg

Victory Column, Berlin
https://sprott.carleton.ca/wp-content/files/blogs_rachel_sept23.jpg

Golden Gate Bridge, San Francisco
https://www.busrental.com/cms/user_files/California/SanFrancisco/SanFrancisco_HistoricalSites_Landmarks.jpg To find more about the price options for the pro version visit: https://rapidapi.com/barkal/api/instafly-pro/pricing If you have any questions feel free to reach out at the discussion forum: https://rapidapi.com/barkal/api/instafly-pro/discussions Happy coding! We're always improving the API, expect frequent updates and iterations .

Install SDK for (Node.js)Unirest

OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication