 
			
			
		Introduction
This section outlines the different queries you can perform using the X-MEN Animated Series API. In the sidebar (only on PC), you will find the features presented. By clicking on them, you will be redirected to the desired section.
API's resources
You can access to two location in the API. Both return their information in JSON format.
xmenapiheroku.herokuapp.com/api/
					
												
		    {		
		         characters: "https://xmenapiheroku.herokuapp.com/api/characters",
		         episodes: "https://xmenapiheroku.herokuapp.com/api/episodes"
		    }
					Each resource contains:
Info & Pagination
						When you access to one resource, is presented the info of the API in JSON format. You always will receive six key values:
					
| Key | Type | Characteristics | 
|---|---|---|
| count | int | The length of the response | 
| limit | int | Maximum number of object receive per page | 
| pageCount | int | Total number of pages | 
| page | int | Current page position | 
| prev | string(URL) | Link to the previous page | 
| next | string(URL) | Link to the next page | 
characters
												
		    {		
			 info: {
			    count: ,
			    limit: 20,
			    pageCount: 2,
			    page: 1,
			    prev: null,
			    next: "https://xmenapiheroku.herokuapp.com/api/characters?page=2"
			 }
		    }
					
						Due to the pagination, is possible access to a specific page. For that, you need to complete the final API's resource with /?page=pageNumber. 
						In case of it is not specified, you will receive the first page.  
					
episodes/?page=1
											
		    {		
		         results: [
			    {
				id: 1,
				title: "Night of the Sentinels, Part One",
				number: "S01E01",
				air_date: "31/10/1992"
				plot: "A young teenager has been rejecting her mutant powers ever since she discovered them. But when giant robots track her down, it's up to the X-Men to save her."
			    },...
			 ],
			 info: {
			    count: 76,
			    limit: 20,
			    pageCount: 4,
			    page: 1,
			    prev: null,
			    next: "https://xmenapiheroku.herokuapp.com/api/episodes?page=2"
			 }
		    }
				Characters
						At the moment, the API contains
						  characters.
					
Character data
| Key | Type | Characteristics | 
|---|---|---|
| id | int | Character id number | 
| name | string | Character real name | 
| alias | string | Character alternate identity | 
| description | string | Character brief description | 
| powers | string/array | List of powers | 
| img | string (URL) | Link to the character´s image. The image's size is equal to 300px x 250px. | 
| affiliation | string | Character team group | 
| created | string | Object creation date | 
Get all characters
						All the characters can be got by accessing to  /characters endpoint.
					
/characters
						
					
												
		    {		
			 results: [
			    {
				id: 1,
				name: "Scott Summers",
				alias: "Cyclops",
				description: "He is one of the founding members of the X-Men.",
				powers: "Eye Energy Beams"
				img: "https://cdn.glitch.com/5efd623c-8d1a-4031-846f-78e99ba712ac%2FCyclops.webp",
				affiliation: "X-Men",
				created: "2020-12-26T19:48:26.027Z"
		             },...
			 ],
			 info: {
			    count: ,
			    limit: 20,
			    pageCount: 2,
			    page: 1,
			    prev: null,
			    next: https://xmenapiheroku.herokuapp.com/api/characters?page=2
			 }
		    }
					Get one character by ID
						It is possible using the id of the character like a parameter on the route:  /characters/3.
					
/characters/3
					
				
				
		    {		
			 id: 3,
			 name: "Charles Xavier",
			 alias: "Professor X",
			 description: "He is a powerful telepathic mutant and leader of the X-Men",
			 powers: "Telepathy",
			 img: "https://cdn.glitch.com/5efd623c-8d1a-4031-846f-78e99ba712ac%2FProfessor_X.webp",
			 affiliation: "X-Men"
			 created: "2020-12-26T19:49:09.863Z"
		    }Apply filter
						In case you know the (total/partial) name or alias of the character, is possible to query on the endpoint. You must use ? on the URL and follow the syntax name=value. 
						For example, you must type something like this: ../characters/?name=logan.
/characters/?name=beast
					
				
					
		    {		
			 results: [
			    {
				id: 6,
				name: "Dr. Hank McCoy",
				alias: "Beast",
				description: "He is one of the original members of the X-Men. He has been with the team throughout its history. He has extensive knowledge in 
				chemistry and biology, whose own research was used to nearly destroy mutantkind. He has also been a member of the Avengers",
				powers: [
				   "Extraordinary Agility",
				   "Superhuman Strength",
				   "Blue Beast-like Appearance",
				],
				img: "https://cdn.glitch.com/5efd623c-8d1a-4031-846f-78e99ba712ac%2FBeast.webp",
				affiliation: "X-Men",
				created: "2020-12-26T19:49:37.308Z"
			    }
			 ],
			 info: {
			    count: 1,
			    limit: 20,
			    pageCount: 1,
			    page: 1,
			    prev: null,
			    next: null
			 }
		    }Episodes
						The API contains the
						 76 episodes of the series created by Marvel and produced by Saban Entertainment. 
						The episodes order follow the list published on Disney + platform.
					
Episode data
| Key | Type | Characteristics | 
|---|---|---|
| id | int | Episode id number | 
| title | string | Episode name | 
| number | string | Season and number of the episode | 
| air date | string | Emission date on tv | 
| created | string | Object creation date | 
| plot | string | Synopsis of the episode | 
Get all episodes
						All the episodes can be got by accessing to  /episodes endpoint.
					
/episodes
						
					
												
		    {		
			 results: [
			    {
				id: 1,
				title: "Night of the Sentinels, Part One",
				number: "S01E01",
				air_date: "31/10/1992",
				created: "2020-12-24T12:39:50.500Z"
				plot: "A young teenager has been rejecting her mutant powers ever since she discovered them. But when giant robots track her down, it's up to 
				the X-Men to save her."
		            },...
			 ],
			 info: {
			    count: 76,
			    limit: 20,
			    pageCount: 4,
			    page: 1,
			    prev: null,
			    next: "https://xmenapiheroku.herokuapp.com/api/episodes?page=2"
			 }
		    }
					Get one episode by ID
						It is possible using the id of the episode like a parameter on the route:  /episode/12.
					
/episode/12
					
				
				
		    {		
			 id: 12,
			 title: "Days of Future Past (Part 2 of 2)",
			 number: "S01E12",
			 air_date: "20/03/1993",
			 created: "2020-12-24T13:20:18.674Z"
			 plot: "Gambit sets out to prove his innocence by thwarting an assassination he supposedly caused. Can he succeed?"
		    }Apply filter
						In case you know the number of season, the number of episode or both, is possible to query on the endpoint. You must use ? on the URL and follow the syntax number=value. 
						For example, you must type something like this: ../episodes/?number=S04E05. 
						One example applying a filter by season could be: ../episodes/?number=S01 and by episode: ../episodes/?number=E01.
						You can do your petition using both lowercase and uppercase.
/episodes?number=E05
					
				
					
		    {		
			 results: [
			    {
			        id: 5,
				title: "Captive Hearts",
				number: "S01E05",
				air_date: "30/01/1993",
				created: "2020-12-24T13:19:10.428Z"
				plot: "Wolverine has strong feeling for Jean Grey, but she's with Cyclops. Storm has a paralyzing case of claustrophobia and must overcome this as 
				the X-Men venture into the New York sewers to rescue Jean Grey and Cyclops from a deformed race of mutants called the Morlocks. Storm confronts 
				the leader of the Morlocks, Callisto, who wants Cyclops to rule beside her as king."
			    },
			    {
			        id: 18,
				title: Repo Man",
				number: "S02E05",
				air_date: "20/11/1993",
				created: "2020-12-24T13:20:18.674Z"
				plot: "After Wolverine has been lured to Canada by an alleged message from his old friend, Heather Hudson, he finds himself fighting Heather's husband, 
				Vindicator, and the Canadian super team, Alpha Flight, instead. Alpha Flight believes that they were only sent after Wolverine to get him to rejoin their team. However, their General Chasen has
				a more sinister agenda: to retrieve Wolverine's adamantium skeleton -- at any cost."
			    }...
			 ],
			 info: {
			    count: 5,
			    limit: 20,
			    pageCount: 1,
			    page: 1,
			    prev: null,
			    next: null
			 }
		    }