Neuron Powered Motorization

    @reallyuseful/youmail-client
    TypeScript icon, indicating that this package has built-in type declarations

    2.4.0 • Public • Published

    @reallyuseful/youmail-client

    npm dependencies license node

    A Node.js interface for the YouMail Spam Caller API (Unofficial)

    Use the YouMail Spam Caller API to determine if an incoming phone call is likely to be a spammer.

    const { YouMailClient } = require('@reallyuseful/youmail-client');
    
    async function main() {
      const client = new YouMailClient('your api key', 'your api sid');
    
      // simple lookup
      let result = await client.lookup('caller phone number');
    
      // advanced lookup (passing in caller ID and/or callee)
      result = await client.lookup({
        callerNumber: 'caller phone number',
        callerId: 'caller’s caller ID',
        calledNumber: 'callee phone number'
      });
    
      console.log(result.ok); // true if the request succeeded
    
      console.log(result.spamRisk);
      // 0 = not a spammer
      // 1 = possible spam
      // 2 = highly likely to be spam
      // undefined = no record found
    
      console.log(result.raw);
      // the full response from YouMail:
      // {
      //   "statusCode": 10000,
      //   "recordFound": true,
      //   "phoneNumber": 9991002000,
      //   "spamRisk": { "level": 1 },
      //   "timestamp": "2016-10-06T00:31:04.362Z"
      // }
    }
    
    main()
      .catch(error => console.error(error))
      .then(() => process.exit());

    Install

    npm i @reallyuseful/youmail-client

    DownloadsWeekly Downloads

    203

    Version

    2.4.0

    License

    MIT

    Unpacked Size

    35.3 kB

    Total Files

    24

    Last publish

    Collaborators

    • natesilva