Skip to content

Instantly share code, notes, and snippets.

@HorlogeSkynet
Last active November 1, 2021 20:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HorlogeSkynet/e9a5f7a0a4da8014035238786c288f2a to your computer and use it in GitHub Desktop.
Save HorlogeSkynet/e9a5f7a0a4da8014035238786c288f2a to your computer and use it in GitHub Desktop.
mySetup.co's APIs documentation
<script src="https://mysetup.co/api/widgets.js"></script>
<div class="mysetup-embed" ms-setup="YOUR_SETUP_ID" ms-width="350">Setup powered by <a href="https://mysetup.co/">mySetup.co</a></div>

getSetups

A simple HTTP endpoint to fetch setups hosted on mySetup.co

Specifications

  • Endpoint : /api/getSetups
  • HTTP verb allowed : GET
  • Parameters available :
    • q : Query (string) to search for (3 characters or more)
    • f : 1 to fetch only the featured setups (or not [default])
    • o : ASC or DESC [default] for the order
    • n : Integer between 1 and 16 to limit the results set size [8 by default]
    • p : Integer to shift the results set [0 by default]
    • t : like or date [default] to sort the results set
    • w : Integer to fetch only the setups younger than the number of weeks specified
    • x : 1 to enable "fuzzy" search when q is specified (or not [default])
  • Rate limitation : 100 requests per minute
  • HTTP return codes :
    • 200 on success
    • 412 when there is a bad parameter
    • 429 when rate limitation is reached
  • Return values format : JSON object (and main_colors is a JSON-encoded string)
  • Return values fields : See example below.
  • Version : v1.4

Example

[user@host]$ curl -s https://mysetup.co/api/getSetups?n=2 | json_pp
[
	{
		"id": 1003227043,
		"user_id": 994774516,
		"title": "My Home Setup",
		"creationDate": "2017-05-02T11:52:54+00:00",
		"status": "PUBLISHED",
		"like_count": 7,
		"featured": false,
		"main_colors": "[[24,31,54],[42,45,55],[192,190,183],[153,162,176],[72,106,197]]",
		"user": {
			"id": 994774516,
			"name": "Corentin Mors",
			"modificationDate": "2018-03-12T10:24:31+00:00"
		},
		"resources": [
			{
				"setup_id": 1003227043,
				"src": "uploads/files/994774516/a80fa1a9-bc7e-425e-a4f8-e42060e8d230.jpg"
			}
		]
	},
	{
		"id": 2142881839,
		"user_id": 1831119721,
		"title": "Datenshi's setup",
		"creationDate": "2017-05-02T16:31:32+00:00",
		"status": "PUBLISHED",
		"featured": false,
		"like_count": 3,
		"main_colors": "[[87,87,74],[50,53,58],[195,182,170],[97,102,181],[143,170,184]]",
		"user": {
			"id": 1831119721,
			"name": "Datenshi",
			"modificationDate": "2018-02-01T22:07:47+00:00"
		},
		"resources": [
			{
				"setup_id": 2142881839,
				"src": "uploads/files/1831119721/23eb3b1a-783a-42c9-9090-466b20d56f87.jpg"
			}
		]
	}
]

Let me play with it

Here you are !

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