Keeping track of new knowledge base articles is a great way to stay connected to what’s happening in your community. Maybe you want to give a shout-out to members who are sharing helpful content, spot emerging experts, or just make sure your team knows when fresh resources are available. While the analytics side of things isn’t quite set up yet to track article creation directly, the Vanilla Forums API makes it easy to pull a list of the newest articles. With just a simple call, you can see who’s contributing and what they’re posting — and use that info to celebrate, share, and encourage even more participation.
We're going into a bit more detail on how this call works but for those that just want the answer, here it is - just drop this URL after your community domain in the URL bar:
/api/v2/articles?expand%5B0%5D=excerpt&limit=10&statuses%5B0%5D=published&sort=-dateInserted
And if you want the CSV download:
/api/v2/articles.csv?expand%5B0%5D=excerpt&limit=10&statuses%5B0%5D=published&sort=-dateInserted
Now, let's get into it.
Prerequisites
- Knowledgebase in use on your community
- Admin access to your Vanilla community (mostly if your KB is gated in any way)
- Valid API token with appropriate permissions (if using an external API tool)
Call Breakdown
To get this information, we're making a GET
API call, meaning we're not changing anything on the community - just retrieving information that's available to my current user or the user associated with the generated API token.
In this case, we're getting information on the Articles
endpoint (API Reference). This focuses our GET query on the articles data in the community. In theory, this endpoint could let us delete articles, create new articles, update existing articles, create article drafts - anything article related.
We could drop /api/v2/articles
straight into the URL bar (after your community domain) and it would give you a ton of information about your articles - but for the purpose of this API Sprinkle, we want to organize the data so it's a bit more helpful.
The Parameters
This is all the fun bits after the expand
part of the call that let us really customize the data we get in the response.
excerpt
- This part of the call is completely optional. The excerpt pulls a little bit of the article's body into the API response, which in my opinion, is helpful in remembering what an article is about. It's just there to give you some more context about the data you're looking at.
limit=10
- The limit lets us decide how many articles get referenced in each page of the response. You can update this to any number that you want (up to 100).
statuses%5B0%5D=published
- Here I indicate that we're only interested in seeing articles that are published. For the articles
endpoint, the other status I could use is deleted
. If you remove this parameter from the call, the API will return articles with either status.
sort=-dateInserted
- The sort tells the call how the information should be ordered. Here we indicate -dateInserted
which puts the information from the newest to the oldest. Some of the other sort options are:
dateInserted
- Oldest to newest, based on when the article was createddateUpdated
- Oldest to newest, based on when the article was last edited.articleID
- First articleID to the latest
Putting a -
before each sort option reverses the order, so it'll give the newest information first. Note that we're using -dateInserted
in our call because we want to see the most recently created articles first.
Conclusion
And that’s all there is to it! With just a few tweaks to the parameters, you can shape the response to fit whatever you need (you can get real in-depth by playing with the API docs in your dashboard: /settings/api-docs#/articles/get_articles
) — whether that’s highlighting the latest contributions in a team meeting, sharing new content in a newsletter, or keeping tabs on who’s been especially active in your knowledge base. The Articles endpoint is flexible enough to give you the right mix of detail and context without making things complicated.
Give it a try, and you’ll have a quick, reliable way to surface the newest knowledge your community is creating.
Let us know if you have any questions! If you're doing something especially cool with this data to highlight article creators in your community, we'd love to hear that too!