{"id":16383340,"url":"https://github.com/shakaran/adstxtparser","last_synced_at":"2025-10-26T11:30:45.014Z","repository":{"id":57074273,"uuid":"137263871","full_name":"shakaran/adstxtparser","owner":"shakaran","description":"⤴ 📮 A open source implementation in PHP of Ads.txt Specification Version 1.0.1 (OpenRTB working group)","archived":false,"fork":false,"pushed_at":"2023-11-22T11:39:40.000Z","size":50,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-16T19:33:29.077Z","etag":null,"topics":["advertisement-management","advertisers","advertising","advertising-api","advertising-tool","composer-package","library","php","php7"],"latest_commit_sha":null,"homepage":"https://shakaran.net/blog","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shakaran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["shakaran"],"patreon":"shakaran","custom":["https://www.paypal.me/quijost","shakaran.net"]}},"created_at":"2018-06-13T19:55:24.000Z","updated_at":"2023-07-29T10:52:47.000Z","dependencies_parsed_at":"2022-08-24T14:54:52.333Z","dependency_job_id":null,"html_url":"https://github.com/shakaran/adstxtparser","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakaran%2Fadstxtparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakaran%2Fadstxtparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakaran%2Fadstxtparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakaran%2Fadstxtparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shakaran","download_url":"https://codeload.github.com/shakaran/adstxtparser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238319243,"owners_count":19452308,"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":["advertisement-management","advertisers","advertising","advertising-api","advertising-tool","composer-package","library","php","php7"],"created_at":"2024-10-11T04:08:03.200Z","updated_at":"2025-10-26T11:30:37.725Z","avatar_url":"https://github.com/shakaran.png","language":"PHP","funding_links":["https://github.com/sponsors/shakaran","https://patreon.com/shakaran","https://www.paypal.me/quijost","shakaran.net","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=KY8JY46S5WPWS"],"categories":[],"sub_categories":[],"readme":"# AdsTxtParser\n\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)][3]\n[![Build Status](https://travis-ci.org/shakaran/adstxtparser.svg?branch=master)](https://travis-ci.org/shakaran/adstxtparser)\n[![Latest Stable Version](https://poser.pugx.org/shakaran/adstxtparsere/v/stable.png)](https://packagist.org/packages/shakaran/adstxtparser)\n[![Latest Unstable Version](https://poser.pugx.org/shakaran/adstxtparser/v/unstable)](https://packagist.org/packages/shakaran/adstxtparser)\n[![License](https://poser.pugx.org/shakaran/adstxtparser/license)](https://packagist.org/packages/shakaran/adstxtparser)\n\n\n[![Total Downloads](https://poser.pugx.org/shakaran/adstxtparser/downloads.png)](https://packagist.org/packages/shakaran/adstxtparser)\n[![Monthly Downloads](https://poser.pugx.org/shakaran/adstxtparser/d/monthly)](https://packagist.org/packages/shakaran/adstxtparser)\n[![Daily Downloads](https://poser.pugx.org/shakaran/adstxtparser/d/daily)](https://packagist.org/packages/shakaran/adstxtparser)\n\n\n\nA open source implentation in PHP of [Ads.txt Specification Version 1.0.1](https://iabtechlab.com/wp-content/uploads/2017/09/IABOpenRTB_Ads.txt_Public_Spec_V1-0-1.pdf) (OpenRTB working group)\n\n![Graph Ads.txt](https://i.imgur.com/NnVCHz9.png)\n\nNote: \nADS = Authorized Digital Sellers\nDSP = Demand Side Platforms \n\n## WHAT IS ADS.TXT? ##\n\nAds.txt is an initiative by the Interactive Advertising Bureau to enable publishers to take control over who can sell their ad inventory.\n\nSince 01 Nov 2017 Google is filtering traffic based on ads.txt\n\nIt is a simple logic of the textfile as mechanism to fight adfraud\n\nWidely accepted and implemented by more and more publishers, ssp and dsp.\n\nCan prevent advertisers from buying invalid traffic.\n\n[Check more info](https://iabtechlab.com/ads-txt/) about it.\n\n## Donate ##\n\nI am a freelancer [Senior Backend Engineer](https://upwork.com/fl/angelguzmanmaeso#/) working on my free time for develop this.\n\nIf you want pay me some beer or severals to appreciate the efforts:\n\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=KY8JY46S5WPWS)\n\n## Setup ##\n\nInstall with composer with only:\n\n```cli\ncomposer require shakaran/adstxtparser\n```\n\n## TECHNICAL NOTES ##\n\nRequires PHP 7.0+.\n\n## How to use ##\n\nA quick use to instanciate and run over a domain is:\n\n```php\n\nuse AdsTxtParser\\Parser;\n\n$parser = new Parser();\n$parser-\u003ereadExternalFile('http://estaticos.elmundo.es');\n```\n\nNote: that you only have to pass as argument the domain.\n\nAfter you already fetch the data in the Parser object,\nyou can query about errors:\n\n```php\n$errors = $parser-\u003egetErrors();\n```\n\nOr warnings:\n\n```php\n$warnings = $parser-\u003egetWarnings();\n```\n\nOr get the variables defined:\n\n```php\n$variables = $parser-\u003egetVariables();\n```\n\nOr get the fields defined:\n\n```php\n$fields = $parser-\u003egetFields();\n```\n\nOr get the comments defined:\n\n```php\n$comments = $parser-\u003egetComments();\n```\n\nEven more complex operations, as know the list of resellers:\n\n```php\n$resellers = $parser-\u003egetResellers();\n```\n\nOr the list or directs:\n\n```php\n$directs = $parser-\u003egetDirects();\n```\n\nA complex example using all the options could be:\n\n```php\ntry\n        {\n            // By default localhost\n            $parser = new Parser();\n            $parser-\u003ereadExternalFile('http://estaticos.elmundo.es');\n\n            // More examples to test:\n            // https://elpais.com/ads.txt\n            // https://www.elconfidencial.com/ads.txt\n        }\n        catch(AdsFileNotFound $e)\n        {\n            echo $e-\u003egetMessage();\n        }\n\n        $comments = $parser-\u003egetComments();\n        // var_dump($comments);\n\n        $errors = $parser-\u003egetErrors();\n        //var_dump($errors);\n\n        $warnings = $parser-\u003egetWarnings();\n        // var_dump($warnings);\n\n        $fields = $parser-\u003egetFields();\n        // var_dump($fields);\n\n        $variables = $parser-\u003egetVariables();\n        //var_dump($variables);\n\n        $resellers = $parser-\u003egetResellers();\n        //var_dump(count($resellers));\n\n        $directs = $parser-\u003egetDirects();\n        //var_dump(count($directs));\n```\n\n## Tests ##\n\nExecuting the tests:\n\nRun a local webserver under Test directory:\n\n```cli\ncd Tests; sudo php -S localhost:80\n```\n\n```php\nvendor/phpunvendor/phpunit/phpunit/phpunit --configuration=Tests/phpunit.xml --include-path=Tests\n```\n\n## License ##\n\nAGPLv3 or later, see [LICENSE](LICENSE) file for more details.\n\n[3]: https://github.com/shakaran/adstxtparser/issues?utf8=%E2%9C%93\u0026q=is%3Aopen%20is%3Aissue\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakaran%2Fadstxtparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshakaran%2Fadstxtparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakaran%2Fadstxtparser/lists"}