Skip to content

OpenAPI Specification

The full OpenAPI specification for the NSO Connect API which can be used to generate libraries, SDKs, and documentation.

openapi: 3.0.0
info:
title: NSO Connect
description: NSO Connect is a free and easy to use API that allows you to query servers of Nintendo Switch Online microservices.
license:
name: MIT
url: https://opensource.org/license/mit
version: 1.0.0
externalDocs:
description: View the full documentation
url: https://docs.hfcred.dev/nso-connect/overview
servers:
- url: https://nso-connect.dev
tags:
- name: Authorization
description: Retrieve and handle tokens
- name: Service
description: Make service specific requests
paths:
/authorization/link:
get:
tags:
- Authorization
summary: Generate an authorization link
description: Generate a Nintendo Switch Online authorization link to obtain the login link to generate a session token
security:
- api_key: []
responses:
'200':
description: Success
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- properties:
error:
type: boolean
example: false
data:
type: object
properties:
link:
type: string
description: Authorization link used to get the login link
example: https://accounts.nintendo.com/connect/1.0.0/authorize...
verifier:
type: string
description: Verifier used to verify the login link
example: fNz1Y_YK0igURr...
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
example: Invalid authorization
/authorization/sessiontoken:
post:
tags:
- Authorization
summary: Generate a session token
description: Generate a session token for the account associated with the login link obtained through the authorization link
security:
- api_key: []
requestBody:
description: Requires the login link obtained through the /authorization/link endpoint and the verifier associated with the login link
required: true
content:
application/json:
schema:
type: object
properties:
loginLink:
type: string
description: Login link obtained from the authorization link
verifier:
type: string
description: Verifier associated with the login link
required:
- loginLink
- verifier
responses:
'200':
description: Success
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- properties:
error:
type: boolean
example: false
data:
type: object
properties:
sessionToken:
type: string
description: Session token used to make queries
example: eyJhbGciOiJIUzI1NiJ9...
'400':
description: Bad Request
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
example: Missing required body field
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
example: Invalid authorization
'502':
description: Bad Gateway
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
type: object
properties:
nintendoResponse:
type: object
description: The error response returned by Nintendos authentication servers
properties:
error_description:
type: string
example: The provided session_token_code is expired
error:
type: string
example: invalid_request
/authorization/delete:
delete:
tags:
- Authorization
summary: Delete all tokens
description: Delete the database entry for the given session token
security:
- session_token: []
responses:
'200':
description: Success
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- properties:
data:
type: string
example: Entry deleted from database
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
example: Invalid authorization
'404':
description: Not Found
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
example: Entry not found in database
/{service}/query:
post:
tags:
- Service
summary: Query data from the given service
description: Query data from any of the available Nintendo Switch Online microservices. Currently available services are Coral and Splatnet 3
security:
- session_token: []
- api_key: []
parameters:
- in: path
name: service
description: Name of the service you want to query
required: true
schema:
type: string
example: splatnet3
- in: header
name: X-Agent
description: Name of your application. Should either be in the format {appName}/{version} or provide contact information
required: true
schema:
type: string
example: docs/1.0.0
- in: header
name: X-Language
description: Language for the query results (unused)
required: false
schema:
type: string
example: en-US
default: en-US
requestBody:
description: Requires an array of simple and/or complex queries that you want to perform on the given service
required: true
content:
application/json:
schema:
type: object
properties:
simpleQueries:
type: array
description: String array of simple queries you want to perform on the given service
items:
type: string
example: ''
detailedQueries:
type: array
description: Object array of complex queries you want to perform on the given service
items:
type: object
example: {}
responses:
'200':
description: Success
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- properties:
data:
type: array
description: Array of objects containing the query responses in the same order as defined in the request body
items:
anyOf:
- type: object
properties:
error:
type: boolean
example: false
data:
type: object
example: {}
- type: object
properties:
error:
type: boolean
example: true
message:
type: string
example: 'Failed to fetch query'
'400':
description: Bad Request
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
example: Invalid service
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
example: Invalid authorization
'409':
description: Conflict
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
example: Another process is already running
'429':
description: Too Many Requests
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
example: Rate limit exceeded
'500':
description: Internal Server Error
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
example: Failed to generate tokens
'502':
description: Bad Gateway
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
type: object
properties:
step:
type: string
description: The authentication step which caused the error
example: 0/7 (getting user access token)
nintendoResponse:
type: object
description: The error response returned by Nintendos authentication servers
properties:
error_description:
type: string
example: The provided grant is invalid
error:
type: string
example: invalid_grant
/{service}/querylist:
get:
tags:
- Service
summary: Get a list of all queries
description: Get a list of all possible queries for any of the available microservices. Currently available services are Coral and Splatnet 3
parameters:
- in: path
name: service
required: true
schema:
type: string
description: Name of the service you want to query
responses:
'200':
description: Success
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- properties:
data:
type: object
properties:
simpleQueries:
type: array
description: String array of simple queries you can perform on the given service
items:
type: string
example: ''
detailedQueries:
type: object
description: Object array of complex queries you can perform on the given service
example: {}
'400':
description: Bad Request
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- properties:
message:
example: Invalid service
components:
schemas:
ErrorResponse:
type: object
properties:
error:
type: boolean
example: true
message:
type: string
SuccessResponse:
type: object
properties:
error:
type: boolean
example: false
data:
type: object
securitySchemes:
session_token:
type: http
scheme: bearer
api_key:
type: http
scheme: bearer