Skip to content

Instantly share code, notes, and snippets.

@chris-sev
Created December 11, 2018 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-sev/aee0c50af271285aadd974d6076a98ab to your computer and use it in GitHub Desktop.
Save chris-sev/aee0c50af271285aadd974d6076a98ab to your computer and use it in GitHub Desktop.
Scotch.io Public Posts API

The Scotch.io public API sits at:

https://scotch.io/api/f/posts

You can filter, sort, and include relationships using query params. There's more docs below but the URL you'll most likely use is:

https://scotch.io/api/f/posts?sort=-published_at&include=author,stats,tags,category

Sorting

You'll probably want to sort by latest published. You can do that using ?sort=-published_at

https://scotch.io/api/f/posts?sort=-published_at

Including Relationships

You can use &include=author,stats,tags,category

https://scotch.io/api/f/posts?include=author,stats,tags,category

Filtering

This will probably be the URL you'll use the most:

https://scotch.io/api/f/posts?filter[user_id]=1

Pagination

We follow the json:api spec that expects page[number] and page[size]. For instance to get only 5 posts:

https://scotch.io/api/f/posts?page[size]=5

Showing a Single Post

You can show a single post by passing in the id as the final url segment.

https://scotch.io/api/f/posts/39720
@ShivamRawat
Copy link

In filtering can i filter using name ? Like for search implementation ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment