Giter VIP home page Giter VIP logo

php-scrapper-curp-rfc-mexico's Introduction

PHP - Getting CURP and RFC [ México ]

  • This personal data (JSON response) must be validated with RENAPO site and should not therefore be considered as official.

  • This PHP script is a simple Web scraping that request data to the page: http://www.ossc.com.mx/curp.php

Example

You can execute the example by typing following into your local shell

❯ php src/index.php
include_once 'CurpRfcProperties.php';
include_once 'processRequest.php';

$person = new CurpRfcProperties();
$person
    ->setFirstName('LESLIE')
    ->setFirstSurname('NIELSEN')
    ->setSecondSurname('SMITH')
    ->setGender('Hombre')
    ->setEntity('DURANGO')
    ->setDateOfBirth(new \DateTime('1990-01-20'));
$request = new processRequest();
$result = $request->processRequestCurpRfc($person);

print_r($result);

Success output

{
        "full_name": "LESLIE NIELSEN SMITH",
        "rfc": "NISL900120267",
        "curp": "NISL900120HDGLMS01",
        "day_of_birth": "1990-01-20",
        "entity_identifier": "DG",
        "entity_name": "DURANGO",
        "entity_list": [
        {
            "AS": "AGUASCALIENTES",
            "BC": "BAJA CALIFORNIA",
            "BS": "BAJA CALIF. SUR",
            "CC": "CAMPECHE",
            "CS": "CHIAPAS",
            "CH": "CHIHUHUA",
            "CL": "COAHUILA",
            "CM": "COLIMA",
            "DF": "DISTRITO FEDERAL",
            "DG": "DURANGO",
            "GT": "GUANAJUATO",
            "GR": "GUERRERO",
            "HG": "HIDALGO",
            "JC": "JALISCO",
            "MN": "MICHOACAN",
            "MS": "MORELOS",
            "NT": "NAYARIT",
            "NL": "NUEVO LEON",
            "OC": "OAXACA",
            "PL": "PUEBLA",
            "QT": "QUERETARO",
            "QR": "QUINTANA ROO",
            "SP": "SAN LUIS POTOSI",
            "SL": "SINALOA",
            "SR": "SONORA",
            "TC": "TABASCO",
            "TS": "TAMAULIPAS",
            "TL": "TLAXCALA",
            "VZ": "VERACRUZ",
            "YN": "YUCATAN",
            "ZS": "ZACATECAS"
        }],
        "gender_identifier": "H",
        "gender_name": "Hombre",
        "gender_list": [{
            "H": "Hombre",
            "M": "Mujer"
        }
    ]
}

Error output

Array
(
    [error] => Service Unavailable
)

Feel free to fork it or do whatever you want with it.

License: https://creativecommons.org/licenses/by/3.0/

**Edit 2022: I had a look to the resource http://www.ossc.com.mx/curp.php but is not available anymore **

php-scrapper-curp-rfc-mexico's People

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

jolsebastian

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.