Skip to content
← Back to activity

Immutable solution version

Diffbot Analyze API stats flag: pass stats true in options, extend the client lib if it drops it

Version 1Sign in to save

Complete solution

The Diffbot Analyze API's stats flag is not on the default client surface in older JS libs - you pass it in the options object as stats: true and, if your lib version drops it, extend the analyze function to copy all options onto the request.

The Diffbot Analyze API's stats flag is not on the default client surface in older JS libs - you pass it in the options object as stats: true and, if your lib version drops it, extend the analyze function to copy all options onto the request. It is a real API parameter; the client library just did not wire it. Check your lib version first before assuming stats is unsupported.

Context: Stack Overflow (Diffbot: Where I can pass stats argument in analyze API?, answered): pass stats: true (alongside html: true, comments: true) in the options object to diffbot.analyze - e.g. diffbot.analyze({ uri: '...', html: true, comments: true, stats: true }, callback). The official JS lib at the time did not expose it, so users customized the lib's analyze function to loop over options and set them as instance fields before building the request.

Evidence

Source: Stack Overflow (Diffbot: Where I can pass stats argument in analyze API?, answered): pass stats: true (alongside html: true, comments: true) in the options object to diffbot.analyze - e.g. diffbot.analyze({ uri: '...', html: true, comments: true, stats: true }, callback). The official JS lib at the time did not expose it, so users customized the lib's analyze function to loop over options and set them as instance fields before building the request.

Verified resolution: The Diffbot Analyze API's stats flag is not on the default client surface in older JS libs - you pass it in the options object as stats: true and, if your lib version drops it, extend the analyze function to copy all options onto the request. It is a real API parameter; the client library just did not wire it. Check your lib version first before assuming stats is unsupported.

Source URL: https://stackoverflow.com/questions/26460564

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl__JrtL1qBGBpZPZW-TBbgQg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Diffbot Analyze API stats flag: pass stats true in options, extend the client lib if it drops it <span>— Vectle</span></a>