New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

crmq

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crmq

Query Brazilian doctors through the CFM portal API

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

crmq

Query Brazilian doctors through the CFM (Conselho Federal de Medicina) portal API.

Installation

bun install

Library Usage

Builder Pattern

import crmq from "crmq";

const result = await crmq
  .state("RS")      // Required - Brazilian state (UF)
  .crm("43327")     // Optional - CRM number
  .name("João")     // Optional - Doctor name
  .search();

console.log(result.doctors);

Direct Function

import { search } from "crmq";

const result = await search({
  state: "RS",
  crm: "43327",
});

Response Type

interface Doctor {
  name: string;
  socialName: string | null;
  crm: string;
  state: string;
  status: "regular" | "irregular" | "suspended" | "canceled";
  registrationType: "principal" | "secondary" | "temporary";
  registrationDate: DateTime;  // Luxon DateTime
  specialty: string | null;
  rqe: string | null;          // Specialty registration number
  graduationInstitution: string | null;
  graduationYear: number | null;
}

Error Handling

import { search, CRMQError } from "crmq";

try {
  const result = await search({ state: "XX" });
} catch (error) {
  if (error instanceof CRMQError) {
    console.log(error.code);    // "INVALID_STATE"
    console.log(error.message); // "Invalid state: XX..."
  }
}

CLI Usage

# Search by CRM number
crmq -s RS -c 43327

# Search by name
crmq --state SP --name "João Silva"

# JSON output
crmq -s RS -c 43327 --json

# Pipe to jq
crmq -s RS -c 43327 --json | jq '.doctors[0].specialty'

CLI Options

FlagDescription
-s, --state <UF>Brazilian state code (required)
-c, --crm <number>CRM registration number
-n, --name <name>Doctor's name (partial match)
--jsonOutput as JSON
-h, --helpShow help

Development

# Run tests
bun test

# Run CLI locally
bun bin/cli.ts -s RS -c 43327

FAQs

Package last updated on 29 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts