TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How would you design a reporting API? How would you research it?

12 点作者 georgem12将近 11 年前
I&#x27;m trying to design a reporting API for our company (we do real time bidding on advertising). I&#x27;m not sure how to structure it and what conventions to use. (for example, there&#x27;s really nothing to &quot;set&quot; in terms of reporting).<p>How would you design this API? Are there any good books or resources covering this?

5 条评论

smt88将近 11 年前
Good APIs are like good code. You don&#x27;t want to get creative. Instead, you want the API to be usable by being immediately familiar. Follow the lead of popular, well-designed APIs (Parse and Twilio come to mind). You should follow a predictable pattern, which minimizes the amount of time required to learn your API. For example, if your endpoints are in the &quot;&#x2F;[noun]&#x2F;[verb].json&quot; scheme, then you should stick to that all the way through.<p>I suggest starting out by strictly adhering to REST standards, and then choose areas where you want to be flexible to increase usability (allowing POST calls to be overridden and interpreted as PUT calls, for example).<p>Check out this checklist: <a href="https://mathieu.fenniak.net/the-api-checklist/" rel="nofollow">https:&#x2F;&#x2F;mathieu.fenniak.net&#x2F;the-api-checklist&#x2F;</a><p>I can also enthusiastically recommend Apiary (<a href="https://apiary.io" rel="nofollow">https:&#x2F;&#x2F;apiary.io</a>) for designing and mocking up your API. It&#x27;s absolutely fantastic.
me_bx将近 11 年前
Could you elaborate a bit more?<p>By reporting API, do you mean a structured way for some users&#x2F;clients to extract operational data about their activity with your product, in order to let them play with it and do their own reporting on top of it? Or do you mean a layer in your software presenting aggregated data in form or reports?
petervandijck将近 11 年前
To design an API, there are a few good ebooks, well worth the price: <a href="https://leanpub.com/build-apis-you-wont-hate" rel="nofollow">https:&#x2F;&#x2F;leanpub.com&#x2F;build-apis-you-wont-hate</a><p>Not sure what you mean by a &quot;reporting&quot; API?
dtsingletary将近 11 年前
Also worth investigating is <a href="http://apis.io/" rel="nofollow">http:&#x2F;&#x2F;apis.io&#x2F;</a> , a growing repository for API interface design patterns.
WorldWideWayne将近 11 年前
Find some other systems that behaves similarly to the one you want to build and copy their design.