{"id":13436946,"url":"https://github.com/bbc/node-radiodns","last_synced_at":"2025-10-25T02:18:57.887Z","repository":{"id":57332510,"uuid":"87421126","full_name":"bbc/node-radiodns","owner":"bbc","description":"Perform RadioDNS resolutions and service lookups in node.js","archived":false,"fork":false,"pushed_at":"2024-11-27T15:13:30.000Z","size":31,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-03-22T06:51:15.998Z","etag":null,"topics":["dns","nodejs","radiodns"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/radiodns","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbc.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":"2017-04-06T11:22:09.000Z","updated_at":"2021-07-23T09:03:42.000Z","dependencies_parsed_at":"2022-09-15T12:22:22.369Z","dependency_job_id":null,"html_url":"https://github.com/bbc/node-radiodns","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fnode-radiodns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fnode-radiodns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fnode-radiodns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fnode-radiodns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbc","download_url":"https://codeload.github.com/bbc/node-radiodns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247547579,"owners_count":20956577,"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":["dns","nodejs","radiodns"],"created_at":"2024-07-31T03:00:53.268Z","updated_at":"2025-10-25T02:18:52.836Z","avatar_url":"https://github.com/bbc.png","language":"JavaScript","funding_links":[],"categories":["Hybrid Radio"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/bbc/node-radiodns.svg?branch=master)](https://travis-ci.org/bbc/node-radiodns)\n\n\nRadioDNS node.js Library\n========================\n\n## Summary\n\nPerform [RadioDNS] resolutions and service lookups in [node.js].\n\nRadioDNS was standardised in [ETSI TS 103 270],\n_RadioDNS Hybrid Radio; Hybrid lookup for radio services_.\n\n\n## Installation\n\n    npm install --save radiodns\n\n\n## Usage\n\nAdd this to the top of your script\n\n    var radiodns = require('radiodns')\n\nThen if you already have the Fully Qualified Domain Name as specified\nin the RadioDNS spec ([ETSI TS 103 270]), you can resolve it into a CNAME like so\n\n    radiodns.resolve('09580.c479.ce1.fm.radiodns.org', function(err, fqdn) {\n      console.log(fqdn) // =\u003e rdns.musicradio.com\n    })\n\nOr lookup a bearerURI:\n\n    radiodns.resolve('fm:ce1.c479.09580', function(err, fqdn) {\n      console.log(fqdn) // =\u003e rdns.musicradio.com\n    })\n\nYou can also pass in the parameters required to construct the FQDN to\nthe resolve method:\n\n    var params = {\n      system: 'fm',\n      frequency: 95.8,\n      pi: 'c479',\n      ecc: 'e1'\n    }\n\n    radiodns.resolve(params, function(err, fqdn) {\n      console.log(fqdn) // =\u003e rdns.musicradio.com\n    })\n\n\nTo perform the next step and resolve the servers for a specific application:\n\n    var params = {\n      system: 'fm',\n      frequency: 95.8,\n      pi: 'c479',\n      ecc: 'e1'\n    }\n\n    radiodns.resolveApplication(params, 'radiovis', function (err, result) {\n      console.log(result)\n    })\n\nThe `resolveApplication()` function will return an array of servers that serve this application.\nThis is the same as the result of a [dns.resolveSrv] query.\n\nFor example:\n\n    [ { name: 'vis.musicradio.com',\n        port: 61613,\n        priority: 0,\n        weight: 100 } ]\n\n\n\nThe broadcast systems `fm`, `dab`, `drm`, `amss` and `hd` are supported. \nThe required parameters for each of these systems are:\n\n* `fm`: FM with RDS/RBDS\n  * `gcc`: The Global Country Code\n  * `pi`: Received RDS/RBDS Programme Identification code\n  * `frequency`: Frequency on which the service broadcast is received in Mhz\n* `dab`: Digital Audio Broadcasting\n  * `gcc`: The Global Country Code\n  * `eid`: The Ensemble Identifier\n  * `sid`: The Service Identifer\n  * `scids`: The Service Component Identifier (defaults to 0)\n  * `uatype`: The User Application Type (only for data components)\n* `drm`: Digital Radio Mondiale\n  * `sid`: The Service Identifer\n  * `appdomain`: The application domain (only for data components)\n  * `uatype`: The User Application Type (only for data components)\n* `amss`: AM Signalling System\n  * `sid`: The Service Identifer\n* `hd`: IBOC\n  * `tx`: Transmitter Identifier\n  * `cc`: Country Code\n\n\n## Country Resolution\n\nFor FM and DAB The library supports calculating the Global Country Code (gcc)\nfrom Extended Country Code (ecc) - see the FM example at the top.\n\nHowever it is common for FM broadcasts to lack RDS ECC, a field which would otherwise \nconfirm the country of origin of the broadcast. Other information such as the physical \nlocation of the device could be used on its own, however that doesn't consider the \nscenario of being  on or close to a country border. This library enables the accurate \nresolution of the  country of origin by taking as inputs the RDS PI or DAB SID and \nthe two-letter country  code of the physical location of the radio device \n(obtained, for example, using GPS).\n\n    var params = {\n      'system': 'fm',\n      'isoCountryCode': 'GB',\n      'pi': 'c204',\n      'frequency': 96.00\n    }\n\n    radiodns.resolve(params, function(err, fqdn) {\n      console.log(fqdn) // =\u003e radiodns.api.bbci.co.uk\n    })\n\nPassing in invalid parameters with throw an error.\n\nFor more information about country resolution, see the RadioDNS specification - \n[ETSI TS 103 270].\n\n\n## Running Tests\n\n    npm test\n\nTo generate a test coverage report:\n\n    npm run coverage\n\n\n## License\n\nCopyright 2017 British Broadcasting Corporation\n\nThe RadioDNS library for node.js is free software; you can redistribute it and/or\nmodify it under the terms of the Apache License, Version 2.0.\n\nThe RadioDNS library for node.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\nor FITNESS FOR A PARTICULAR PURPOSE.  See the Apache License, Version 2.0 for\nmore details.\n\n\n\n\n[node.js]:         https://nodejs.org/\n[RadioDNS]:        https://en.wikipedia.org/wiki/RadioDNS\n[dns.resolveSrv]:  https://nodejs.org/api/dns.html#dns_dns_resolvesrv_hostname_callback\n[ETSI TS 103 270]: http://www.etsi.org/deliver/etsi_ts/103200_103299/103270/01.01.01_60/ts_103270v010101p.pdf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fnode-radiodns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbc%2Fnode-radiodns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fnode-radiodns/lists"}