Skip to content

dev.to API: per_page=1000 requires state=all parameter #6

@ManningWorks

Description

@ManningWorks

Bug Description

The dev.to API integration has two issues:

1. Missing state=published parameter

The dev.to API requires state=published (or state=all) for per_page=1000 to work. Without it, only 30 articles are returned.

Current URL:

https://dev.to/api/articles?username=${username}&per_page=1000

Should be:

https://dev.to/api/articles?username=${username}&per_page=1000&state=published

2. Views not available from dev.to API

The dev.to public API does not return page_views_count for articles. The current code defaults to 0:

const totalViews = data.reduce((sum, article) => sum + (article.page_views_count ?? 0), 0);

This displays "0 views" which is misleading - it's not that the articles have 0 views, it's that views aren't exposed by the API.

Suggested fix: Only include totalViews in the response if the API actually returns page_views_count values > 0, or skip the views stat entirely for dev.to.

Impact

Users with more than 30 articles will see incomplete article counts. View counts will always show 0 even when articles have actual views.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions