npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@licht-77/dmm-sdk

v1.1.1

Published

DMM Affiliate API v3 SDK for Node.js/TypeScript

Readme

DMM Affiliate API v3 TypeScript SDK

npm version

DMM Affiliate API v3 を TypeScript/JavaScript から簡単に利用するための非公式SDKです。

導入方法

npm または yarn を使用してインストールします。

npm install @licht-77/dmm-sdk

使い方

1. クライアントの初期化

API ID とアフィリエイト ID を指定してクライアントを初期化します。これらは DMM アフィリエイトの管理画面から取得できます。

import { DmmApiClient } from '@licht-77/dmm-sdk';

const client = new DmmApiClient({
  apiId: 'YOUR_API_ID',         // あなたのAPI IDに置き換えてください
  affiliateId: 'YOUR_AFFILIATE_ID', // あなたのアフィリエイト ID に置き換えてください
  // baseUrl: 'https://api.dmm.com/affiliate/v3', // 任意: APIベースURL
});

2. APIの呼び出し

商品検索 (ItemList)

async function searchItems() {
  try {
    const params = {
      site: 'FANZA', // 検索対象サイト ('DMM.com' | 'FANZA')
      service: 'digital', // 検索対象サービス (任意)
      floor: 'videoa',    // 検索対象フロア (任意)
      hits: 10,          // 取得件数 (デフォルト: 20, 最大: 100)
      offset: 1,         // 検索開始位置 (デフォルト: 1)
      sort: 'rank',      // ソート順 (任意)
      keyword: 'キーワード', // 検索キーワード (任意)
      // 絞り込み(配列のみ対応)
      article: ['genre', 'actress'],
      article_id: ['6003', '15187'],
      // ... その他、API仕様で定義されているパラメータ
    };
    const response = await client.getItemList(params);

    console.log('検索結果:', response.items);
    console.log('総件数:', response.total_count);

  } catch (error) {
    console.error('商品検索エラー:', error);
  }
}

searchItems();

補足: article/article_id は配列のみ対応です。SDKはクエリを article[0]=genre&article[1]=actress&article_id[0]=6003&article_id[1]=15187 の形式でエンコードします。

フロア一覧取得 (FloorList)

async function getFloors() {
  try {
    const response = await client.getFloorList();
    console.log('フロア一覧:', response.site);
  } catch (error) {
    console.error('フロア一覧取得エラー:', error);
  }
}

getFloors();

その他の検索API

女優検索 (searchActress), ジャンル検索 (searchGenre), メーカー検索 (searchMaker), シリーズ検索 (searchSeries), 作者検索 (searchAuthor) も同様の形式で利用できます。

// 例: 女優検索
async function searchActresses() {
  try {
    const params = {
      initial: 'あ', // 頭文字 (任意)
      actress_id: '12345', // 女優ID (任意)
      keyword: '女優名', // キーワード (任意)
      hits: 5,
      offset: 1,
    };
    const response = await client.searchActress(params);
    console.log('女優検索結果:', response.actress);
  } catch (error) {
    console.error('女優検索エラー:', error);
  }
}

searchActresses();

各APIの詳細なパラメータについては、DMM Affiliate API v3 の公式ドキュメントを参照してください。

型定義

各APIのリクエストパラメータとレスポンスの型定義も提供されています。TypeScriptプロジェクトで型チェックの恩恵を受けることができます。

import { ItemListRequestParams, ItemListResponse, Item } from '@licht-77/dmm-sdk';

ライセンス

MIT