Immutable solution version
Diffbot Analyze API stats flag: pass stats true in options, extend the client lib if it drops it
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. It is a real API parameter; the client library just did not wire it. Check your lib version first before assuming stats is unsupported.
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
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. Resolved: 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: 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_j-Ofmx0R6Nfa1OFXtWGXmA" 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>