GithubHelp home page GithubHelp logo

salamwaddah / passport-visa-api Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 24 KB

An unofficial passportindex.org API - supports 199 passports

Home Page: https://salamwaddah.com/tools/visa-free/passport/ma

PHP 100.00%
passport

passport-visa-api's Introduction

Passport Visa API

Latest Version on Packagist Total Downloads MIT Licensed

An unofficial passportindex.org API - supports 199 passports

ABANDONED: You may inspect the code but it's no longer maintained, passportindex.org making it more difficult to scrape.

Showcase website

Installation

You can install the package via composer:

composer require salamwaddah/passport-visa-api

Usage

You can get all the visa requirements for a passport by using the get() method.

require_once __DIR__ . '/../vendor/autoload.php';

$passport = \SalamWaddah\PassportVisa\Passport::make('ma');

$passport->get();
// [
//     "visa-free" => ["tr", etc...],
//     "visa-on-arrival" => ["lb", etc...],
//     "electronic-travel-authorization" => ["kr", etc...],
//     "e-visa" => ["jo", etc...],
//     "visa-required" => ["gb", etc...],
//     "not-admitted" => [],
//     "covid-ban" => [],
// ]

Alternatively you can get the visa requirements for a passport by using the methods:

  • listVisaFree()
  • listVisaOnArrival()
  • listEta()
  • listEVisa()
  • listVisaRequired()
  • listNotAdmitted()
  • listCovidBan()
// list of visa free countries for your $passport
$passport->listVisaFree(); // returns ["tr", etc...]

// list of countries which do not admit your $passport
$passport->listNotAdmitted(); // returns []

Caching

This library does not cache the results, you can use your own caching mechanism to avoid unnecessarily calling passportindex.org everytime. A recommended TTL for your cache is 1 day.

Testing

composer test

passport-visa-api's People

Contributors

salamwaddah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

cvcwebsolutions

passport-visa-api's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.