{"id":21826959,"url":"https://github.com/naifalshaye/saudiaddress","last_synced_at":"2025-10-06T00:43:23.720Z","repository":{"id":57023348,"uuid":"142850948","full_name":"naifalshaye/saudiaddress","owner":"naifalshaye","description":"PHP Laravel wrapper for the Saudi National Address APIs. you can get a list of all regions, cities and districts. Also geocode and address verification.","archived":false,"fork":false,"pushed_at":"2019-01-23T13:50:48.000Z","size":17,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-05T01:35:44.747Z","etag":null,"topics":["address","bulding","citites","districts","laravel","laravel-package","lookup","national","national-address","postcode","saudi","saudi-address","verify","zipcode"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naifalshaye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-30T08:59:53.000Z","updated_at":"2024-08-26T09:49:24.000Z","dependencies_parsed_at":"2022-08-23T12:20:47.691Z","dependency_job_id":null,"html_url":"https://github.com/naifalshaye/saudiaddress","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naifalshaye%2Fsaudiaddress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naifalshaye%2Fsaudiaddress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naifalshaye%2Fsaudiaddress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naifalshaye%2Fsaudiaddress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naifalshaye","download_url":"https://codeload.github.com/naifalshaye/saudiaddress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830420,"owners_count":21168272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["address","bulding","citites","districts","laravel","laravel-package","lookup","national","national-address","postcode","saudi","saudi-address","verify","zipcode"],"created_at":"2024-11-27T18:11:38.301Z","updated_at":"2025-10-06T00:43:18.679Z","avatar_url":"https://github.com/naifalshaye.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Laravel wrapper for the Saudi National Address APIs\n\n## Installation\n```\ncomposer require naif/saudiaddress\n```\n\nIf your Laravel below 5.5 you need to add service provider and alias to config/app.php\n```\nNaif\\Saudiaddress\\SaudiAddressServiceProvider::class,\n'SaudiAddress' =\u003e Naif\\Saudiaddress\\Facades\\SaudiAddress::class,\n```\n## API KEYS\nObtain your National Address API key from https://api.address.gov.sa/\n\nAdd these to your .env\n```\nSAUDI_ADDRESS_API_URL=https://apina.address.gov.sa/NationalAddress/v3.1\nSAUDI_ADDRESS_API_KEY=XXXXXXXXXXXXXXXXX\n```\n## Usage\n\nGet a list of regions\n```\n$regions = SaudiAddress::regions();\n\nResponse:\n[\n  0 =\u003e {#181\n    +\"Id\": \"12\"\n    +\"Name\": \" الباحة\"\n  }\n  1 =\u003e {#182\n    +\"Id\": \"13\"\n    +\"Name\": \" الجوف\"\n  }\n  2 =\u003e {#188\n    +\"Id\": \"9\"\n    +\"Name\": \" الحدود الشمالية\"\n  }\n  3 =\u003e {#189\n    +\"Id\": \"1\"\n    +\"Name\": \" الرياض\"\n  }\n]\n```\nGet a list of cities within a region (by region id)\n* To get a list of all cities don't pass a region id\n```\n$cities = SaudiAddress::cities(1);\n\nResponse:\n[\n  0 =\u003e {#183\n    +\"Id\": \"3\"\n    +\"Name\": \"الرياض\"\n  }\n  1 =\u003e {#189\n    +\"Id\": \"1061\"\n    +\"Name\": \"الخرج\"\n  }\n  2 =\u003e {#190\n    +\"Id\": \"828\"\n    +\"Name\": \"الدرعية\"\n  }\n  3 =\u003e {#191\n    +\"Id\": \"669\"\n    +\"Name\": \"الدوادمي\"\n  }\n]\n```\n\nGet a list of districts within a city (by city id)\n\n```\n$districts = SaudiAddress::districts(1);\n\nResponse:\n[\n  0 =\u003e {#184\n    +\"Id\": \"10700001041\"\n    +\"Name\": \"اسكان قوى الامن العام\"\n  }\n  1 =\u003e {#190\n    +\"Id\": \"10700001018\"\n    +\"Name\": \"حي ابو سبعة\"\n  }\n  2 =\u003e {#191\n    +\"Id\": \"10700001021\"\n    +\"Name\": \"حي البساتين\"\n  }\n  3 =\u003e {#192\n    +\"Id\": \"10700001030\"\n    +\"Name\": \"حي الخالدية\"\n  }\n  4 =\u003e {#193\n    +\"Id\": \"10700001044\"\n    +\"Name\": \"حي الرابية\"\n  }\n  5 =\u003e {#194\n    +\"Id\": \"10700001012\"\n    +\"Name\": \"حي الروضة\"\n  }\n]\n```\n\nGeocode, to get address details by geo location (latitude,longitude)\n```\n$address = SaudiAddress::geoCode(24.774265,46.738586);\n\nResponse:\n[\n  +\"Title\": null\n  +\"Address1\": \"7596 الديوان - Al Hamra Dist.,حي الحمراء\"\n  +\"Address2\": \"RIYADH,الرياض 13216 - 2802\"\n  +\"ObjLatLng\": \"1\"\n  +\"BuildingNumber\": \"7596\"\n  +\"Street\": \"الديوان\"\n  +\"District\": \"Al Hamra Dist.,حي الحمراء\"\n  +\"City\": \"RIYADH,الرياض\"\n  +\"PostCode\": \"13216\"\n  +\"AdditionalNumber\": \"2802\"\n  +\"RegionName\": \"منطقة الرياض\"\n  +\"PolygonString\": null\n  +\"IsPrimaryAddress\": null\n  +\"UnitNumber\": null\n  +\"Latitude\": null\n  +\"Longitude\": null\n  +\"CityId\": \"3\"\n  +\"RegionId\": null\n  +\"Restriction\": \"Null\"\n  +\"PKAddressID\": null\n  +\"DistrictID\": null\n  +\"Title_L2\": null\n  +\"RegionName_L2\": null\n  +\"City_L2\": null\n  +\"Street_L2\": null\n  +\"District_L2\": null\n  +\"CompanyName_L2\": null\n  +\"GovernorateID\": null\n  +\"Governorate\": null\n  +\"Governorate_L2\": null\n  ]\n```\n\nVerify an address by (Bulding No, PostCode, Additional No)\n```\n$verify = SaudiAddress::verify(7596,13216,2802);\n\nResponse:\n\ntrue/false\n```\nTo get results in English, just pass 'E' as a last paramater.\nExample\n```\n$districts = SaudiAddress::districts(1,'E');\n```\n## Support:\nnaif@naif.io\n\nhttps://www.linkedin.com/in/naif\n\n## License\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaifalshaye%2Fsaudiaddress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaifalshaye%2Fsaudiaddress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaifalshaye%2Fsaudiaddress/lists"}