1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
|
<p align="center">
<a href="https://github.com/ghoshRitesh12/aniwatch-api">
<img
src="https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/hianime_v2.png"
alt="aniwatch_logo"
width="175"
height="175"
decoding="async"
fetchpriority="high"
/>
</a>
</p>
# <p align="center">Aniwatch API</p>
<div align="center">
A free RESTful API serving anime information from <a href="https://hianime.to" target="_blank">hianime.to</a>
<br/>
<div>
<a
href="https://github.com/ghoshRitesh12/aniwatch-api/issues/new?assignees=ghoshRitesh12&labels=bug&template=bug-report.yml"
>
Bug report
</a>
ยท
<a
href="https://github.com/ghoshRitesh12/aniwatch-api/issues/new?assignees=ghoshRitesh12&labels=enhancement&template=feature-request.md"
>
Feature request
</a>
</div>
</div>
<br/>
<div align="center">
[](https://github.com/ghoshRitesh12/aniwatch-api/actions/workflows/codeql-analysis.yml)
[](https://github.com/ghoshRitesh12/aniwatch-api/actions/workflows/docker-build.yml)
[](https://github.com/ghoshRitesh12/aniwatch-api/actions/workflows/test.yml)
[](https://github.com/ghoshRitesh12/aniwatch-api/blob/main/LICENSE)
</div>
<div align="center">
[](https://github.com/ghoshRitesh12/aniwatch-api/stargazers)
[](https://github.com/ghoshRitesh12/aniwatch-api/network/members)
[](https://github.com/ghoshRitesh12/aniwatch-api/issues?q=is%3Aissue+is%3Aopen+)
[](https://github.com/ghoshRitesh12/aniwatch-api/releases/latest)
</div>
> [!IMPORTANT]
>
> 1. [https://api-aniwatch.onrender.com](https://api-aniwatch.onrender.com/) is only meant to demo the API and has rate-limiting enabled to minimize bandwidth consumption. It is recommended to deploy your own instance for personal use by customizing the API as you need it to be.
> 2. This API is just an unofficial API for [hianime.to](https://hianime.to) and is in no other way officially related to the same.
> 3. The content that this API provides is not mine, nor is it hosted by me. These belong to their respective owners. This API just demonstrates how to build an API that scrapes websites and uses their content.
## Table of Contents
- [Installation](#installation)
- [Local](#local)
- [Docker](#docker)
- [Configuration](#๏ธconfiguration)
- [Custom HTTP Headers](#custom-http-headers)
- [Environment Variables](#environment-variables)
- [Host your instance](#host-your-instance)
- [Vercel](#vercel)
- [Render](#render)
- [Documentation](#documentation)
- [GET Anime Home Page](#get-anime-home-page)
- [GET Anime A-Z List](#get-anime-a-z-list)
- [GET Anime Qtip Info](#get-anime-qtip-info)
- [GET Anime About Info](#get-anime-about-info)
- [GET Search Results](#get-search-results)
- [GET Search Suggestions](#get-search-suggestions)
- [GET Producer Animes](#get-producer-animes)
- [GET Genre Animes](#get-genre-animes)
- [GET Category Animes](#get-category-animes)
- [GET Estimated Schedules](#get-estimated-schedules)
- [GET Anime Episodes](#get-anime-episodes)
- [GET Anime Episode Servers](#get-anime-episode-servers)
- [GET Anime Episode Streaming Links](#get-anime-episode-streaming-links)
- [Development](#development)
- [Contributors](#contributors)
- [Thanks](#thanks)
- [Support](#support)
- [License](#license)
- [Star History](#star-history)
## <span id="installation">๐ป Installation</span>
### Local
1. Clone the repository and move into the directory.
```bash
git clone https://github.com/ghoshRitesh12/aniwatch-api.git
cd aniwatch-api
```
2. Install all the dependencies.
```bash
npm i #or yarn install or pnpm i
```
3. Start the server!
```bash
npm start #or yarn start or pnpm start
```
Now the server should be running on [http://localhost:4000](http://localhost:4000)
### Docker
The Docker image is available at [The GitHub Container Registry](https://github.com/ghoshRitesh12/aniwatch-api/pkgs/container/aniwatch).
Run the following commands to pull and run the docker image.
```bash
docker run -d --name aniwatch-api -p 4000:4000 ghcr.io/ghoshritesh12/aniwatch
```
The above command will start the server on port 4000. You can access the server at [http://localhost:4000](http://localhost:4000), and you can also change the port by changing the `-p` option to `-p <port>:4000`.
The `-d` flag runs the container in detached mode, and the `--name` flag is used to name the container that's about to run.
## <span id="configuration">โ๏ธ Configuration</span>
### Custom HTTP Headers
Currently this API supports parsing of only one custom header, and more may be implemented in the future to accommodate varying needs.
- `X-ANIWATCH-CACHE-EXPIRY`: this custom header is used to specify the cache expiration duration in **seconds** (defaults to 60 if the header is missing). The `ANIWATCH_API_REDIS_CONN_URL` env is required for this custom header to function as intended; otherwise, there's no point in setting this custom header.
### Environment Variables
More info can be found in the [`.env.example`](https://github.com/ghoshRitesh12/aniwatch-api/blob/main/.env.example) file, where envs' having a value that is contained within `<` `>` angled brackets, commented out or not, are just examples and should be replaced with relevant ones.
- `ANIWATCH_API_PORT`: port number of the aniwatch API.
- `ANIWATCH_API_WINDOW_MS`: duration to track requests for rate limiting (in milliseconds).
- `ANIWATCH_API_MAX_REQS`: maximum number of requests in the `ANIWATCH_API_WINDOW_MS` time period.
- `ANIWATCH_API_CORS_ALLOWED_ORIGINS`: allowed origins, separated by commas and no spaces in between.
- `ANIWATCH_API_VERCEL_DEPLOYMENT`: required for distinguishing Vercel deployment from other ones; set it to true or any other non-zero value.
- `ANIWATCH_API_HOSTNAME`: set this to your api instance's hostname to enable rate limiting, don't have this value if you don't wish to rate limit.
- `ANIWATCH_API_REDIS_CONN_URL`: this env is optional by default and can be set to utilize Redis caching functionality. It has to be a valid connection URL; otherwise, the Redis client can throw unexpected errors.
- `ANIWATCH_API_S_MAXAGE`: specifies the maximum amount of time (in seconds) a resource is considered fresh when served by a CDN cache.
- `ANIWATCH_API_STALE_WHILE_REVALIDATE`: specifies the amount of time (in seconds) a resource is served stale while a new one is fetched.
## <span id="host-your-instance">โ
Host your instance</span>
> [!CAUTION]
>
> For personal deployments:
>
> - If you want to have rate limiting in your application, then set the `ANIWATCH_API_HOSTNAME` env to your deployed instance's hostname; otherwise, don't set or have this env at all. If you set this env to an incorrect value, you may face other issues.
> - It's optional by default, but if you want to have endpoint response caching functionality, then set the `ANIWATCH_API_REDIS_CONN_URL` env to a valid Redis connection URL. If the connection URL is invalid, the Redis client can throw unexpected errors.
> - Remove the if block from the [`server.ts`](https://github.com/ghoshRitesh12/aniwatch-api/blob/main/src/server.ts) file, spanning from lines [61](https://github.com/ghoshRitesh12/aniwatch-api/blob/main/src/server.ts#L61) to [85](https://github.com/ghoshRitesh12/aniwatch-api/blob/main/src/server.ts#L85).
### Vercel
Deploy your own instance of Aniwatch API on Vercel.
[](https://vercel.com/new/clone?repository-url=https://github.com/ghoshRitesh12/aniwatch-api)
> [!NOTE]
>
> When deploying to vercel, set an env named `ANIWATCH_API_VERCEL_DEPLOYMENT` to `true` or any non-zero value, but this env must be present.
### Render
Deploy your own instance of Aniwatch API on Render.
[](https://render.com/deploy?repo=https://github.com/ghoshRitesh12/aniwatch-api)
## <span id="documentation">๐ Documentation</span>
The endpoints exposed by the api are listed below with examples that uses the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API), but you can use any http library.
<details>
<summary>
### `GET` Anime Home Page
</summary>
#### Endpoint
```bash
/api/v2/hianime/home
```
#### Request Sample
```javascript
const resp = await fetch("/api/v2/hianime/home");
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
genres: ["Action", "Cars", "Adventure", ...],
latestEpisodeAnimes: [
{
id: string,
name: string,
poster: string,
type: string,
episodes: {
sub: number,
dub: number,
}
},
{...},
],
spotlightAnimes: [
{
id: string,
name: string,
jname: string,
poster: string,
description: string,
rank: number,
otherInfo: string[],
episodes: {
sub: number,
dub: number,
},
},
{...},
],
top10Animes: {
today: [
{
episodes: {
sub: number,
dub: number,
},
id: string,
name: string,
poster: string,
rank: number
},
{...},
],
month: [...],
week: [...]
},
topAiringAnimes: [
{
id: string,
name: string,
jname: string,
poster: string,
},
{...},
],
topUpcomingAnimes: [
{
id: string,
name: string,
poster: string,
duration: string,
type: string,
rating: string,
episodes: {
sub: number,
dub: number,
}
},
{...},
],
trendingAnimes: [
{
id: string,
name: string,
poster: string,
rank: number,
},
{...},
],
mostPopularAnimes: [
{
id: string,
name: string,
poster: string,
type: string,
episodes: {
sub: number,
dub: number,
}
},
{...},
],
mostFavoriteAnimes: [
{
id: string,
name: string,
poster: string,
type: string,
episodes: {
sub: number,
dub: number,
}
},
{...},
],
latestCompletedAnimes: [
{
id: string,
name: string,
poster: string,
type: string,
episodes: {
sub: number,
dub: number,
}
},
{...},
],
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Anime A-Z List
</summary>
#### Endpoint
```sh
/api/v2/hianime/azlist/{sortOption}?page={page}
```
#### Path Parameters
| Parameter | Type | Description | Required? | Default |
| :----------: | :----: | :-------------------------------------------------------------------------------------------------: | :-------: | :-----: |
| `sortOption` | string | The az-list sort option. Possible values include: "all", "other", "0-9" and all english alphabets . | Yes | -- |
#### Query Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | :----------------------------: | :-------: | :-----: |
| `page` | number | The page number of the result. | No | `1` |
#### Request Sample
```javascript
const resp = await fetch("/api/v2/hianime/azlist/0-9?page=1");
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
sortOption: "0-9",
animes: [
{
id: string,
name: string,
jname: string,
poster: string,
duration: string,
type: string,
rating: string,
episodes: {
sub: number ,
dub: number
}
},
{...}
],
totalPages: 1,
currentPage: 1,
hasNextPage: false
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Anime Qtip Info
</summary>
#### Endpoint
```sh
/api/v2/hianime/qtip/{animeId}
```
#### Query Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | :----------------------------------: | :-------: | :-----: |
| `animeId` | string | The unique anime id (in kebab case). | Yes | -- |
#### Request Sample
```javascript
const resp = await fetch("/api/v2/hianime/qtip/one-piece-100");
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
anime: {
id: "one-piece-100",
name: "One Piece",
malscore: string,
quality: string,
episodes: {
sub: number,
dub: number
},
type: string,
description: string,
jname: string,
synonyms: string,
aired: string,
status: string,
genres: ["Action", "Adventure", "Comedy", "Drama", "Fantasy", "Shounen", "Drama", "Fantasy", "Shounen", "Fantasy", "Shounen", "Shounen", "Super Power"]
}
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Anime About Info
</summary>
#### Endpoint
```sh
/api/v2/hianime/anime/{animeId}
```
#### Query Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | :----------------------------------: | :-------: | :-----: |
| `animeId` | string | The unique anime id (in kebab case). | Yes | -- |
#### Request Sample
```javascript
const resp = await fetch("/api/v2/hianime/anime/attack-on-titan-112");
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
anime: [
info: {
id: string,
name: string,
poster: string,
description: string,
stats: {
rating: string,
quality: string,
episodes: {
sub: number,
dub: number
},
type: string,
duration: string
},
promotionalVideos: [
{
title: string | undefined,
source: string | undefined,
thumbnail: string | undefined
},
{...},
],
characterVoiceActor: [
{
character: {
id: string,
poster: string,
name: string,
cast: string
},
voiceActor: {
id: string,
poster: string,
name: string,
cast: string
}
},
{...},
]
}
moreInfo: {
aired: string,
genres: ["Action", "Mystery", ...],
status: string,
studios: string,
duration: string
...
}
],
mostPopularAnimes: [
{
episodes: {
sub: number,
dub: number,
},
id: string,
jname: string,
name: string,
poster: string,
type: string
},
{...},
],
recommendedAnimes: [
{
id: string,
name: string,
poster: string,
duration: string,
type: string,
rating: string,
episodes: {
sub: number,
dub: number,
}
},
{...},
],
relatedAnimes: [
{
id: string,
name: string,
poster: string,
duration: string,
type: string,
rating: string,
episodes: {
sub: number,
dub: number,
}
},
{...},
],
seasons: [
{
id: string,
name: string,
title: string,
poster: string,
isCurrent: boolean
},
{...}
]
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Search Results
</summary>
#### Endpoint
```sh
# basic example
/api/v2/hianime/search?q={query}&page={page}
# advanced example
/api/v2/hianime/search?q={query}&page={page}&genres={genres}&type={type}&sort={sort}&season={season}&language={sub_or_dub}&status={status}&rated={rating}&start_date={yyyy-mm-dd}&end_date={yyyy-mm-dd}&score={score}
```
#### Query Parameters
| Parameter | Type | Description | Required? | Default |
| :----------: | :----: | :---------------------------------------------------------------: | :-------: | :-----: |
| `q` | string | The search query, i.e. the title of the item you are looking for. | Yes | -- |
| `page` | number | The page number of the result. | No | `1` |
| `type` | string | Type of the anime. eg: `movie` | No | -- |
| `status` | string | Status of the anime. eg: `finished-airing` | No | -- |
| `rated` | string | Rating of the anime. eg: `r+` or `pg-13` | No | -- |
| `score` | string | Score of the anime. eg: `good` or `very-good` | No | -- |
| `season` | string | Season of the aired anime. eg: `spring` | No | -- |
| `language` | string | Language category of the anime. eg: `sub` or `sub-&-dub` | No | -- |
| `start_date` | string | Start date of the anime(yyyy-mm-dd). eg: `2014-10-2` | No | -- |
| `end_date` | string | End date of the anime(yyyy-mm-dd). eg: `2010-12-4` | No | -- |
| `sort` | string | Order of sorting the anime result. eg: `recently-added` | No | -- |
| `genres` | string | Genre of the anime, separated by commas. eg: `isekai,shounen` | No | -- |
> [!TIP]
> For both `start_date` and `end_date`, year must be mentioned. If you wanna omit date or month specify `0` instead.
> Eg: omitting date -> 2014-10-0, omitting month -> 2014-0-12, omitting both -> 2014-0-0
#### Request Sample
```javascript
// basic example
const resp = await fetch("/api/v2/hianime/search?q=titan&page=1");
const data = await resp.json();
console.log(data);
// advanced example
const resp = await fetch(
"/api/v2/hianime/search?q=girls&genres=action,adventure&type=movie&sort=score&season=spring&language=dub&status=finished-airing&rated=pg-13&start_date=2014-0-0&score=good"
);
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
animes: [
{
id: string,
name: string,
poster: string,
duration: string,
type: string,
rating: string,
episodes: {
sub: number,
dub: number,
}
},
{...},
],
mostPopularAnimes: [
{
episodes: {
sub: number,
dub: number,
},
id: string,
jname: string,
name: string,
poster: string,
type: string
},
{...},
],
currentPage: 1,
totalPages: 1,
hasNextPage: false,
searchQuery: string,
searchFilters: {
[filter_name]: [filter_value]
...
}
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Search Suggestions
</summary>
#### Endpoint
```sh
/api/v2/hianime/search/suggestion?q={query}
```
#### Query Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | :--------------------------: | :-------: | :-----: |
| `q` | string | The search suggestion query. | Yes | -- |
#### Request Sample
```javascript
const resp = await fetch("/api/v2/hianime/search/suggestion?q=monster");
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
suggestions: [
{
id: string,
name: string,
poster: string,
jname: string,
moreInfo: ["Jan 21, 2022", "Movie", "17m"]
},
{...},
]
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Producer Animes
</summary>
#### Endpoint
```sh
/api/v2/hianime/producer/{name}?page={page}
```
#### Path Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | :-----------------------------------------: | :-------: | :-----: |
| `name` | string | The name of anime producer (in kebab case). | Yes | -- |
#### Query Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | :----------------------------: | :-------: | :-----: |
| `page` | number | The page number of the result. | No | `1` |
#### Request Sample
```javascript
const resp = await fetch("/api/v2/hianime/producer/toei-animation?page=2");
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
producerName: "Toei Animation Anime",
animes: [
{
id: string,
name: string,
poster: string,
duration: string,
type: string,
rating: string,
episodes: {
sub: number,
dub: number,
}
},
{...},
],
top10Animes: {
today: [
{
episodes: {
sub: number,
dub: number,
},
id: string,
name: string,
poster: string,
rank: number
},
{...},
],
month: [...],
week: [...]
},
topAiringAnimes: [
{
episodes: {
sub: number,
dub: number,
},
id: string,
jname: string,
name: string,
poster: string,
type: string
},
{...},
],
currentPage: 2,
totalPages: 11,
hasNextPage: true
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Genre Animes
</summary>
#### Endpoint
```sh
/api/v2/hianime/genre/{name}?page={page}
```
#### Path Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | :--------------------------------------: | :-------: | :-----: |
| `name` | string | The name of anime genre (in kebab case). | Yes | -- |
#### Query Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | :----------------------------: | :-------: | :-----: |
| `page` | number | The page number of the result. | No | `1` |
#### Request Sample
```javascript
const resp = await fetch("/api/v2/hianime/genre/shounen?page=2");
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
genreName: "Shounen Anime",
animes: [
{
id: string,
name: string,
poster: string,
duration: string,
type: string,
rating: string,
episodes: {
sub: number,
dub: number,
}
},
{...},
],
genres: ["Action", "Cars", "Adventure", ...],
topAiringAnimes: [
{
episodes: {
sub: number,
dub: number,
},
id: string,
jname: string,
name: string,
poster: string,
type: string
},
{...},
],
currentPage: 2,
totalPages: 38,
hasNextPage: true
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Category Animes
</summary>
#### Endpoint
```sh
/api/v2/hianime/category/{name}?page={page}
```
#### Path Parameters
| Parameter | Type | Description | Required? | Default |
| :--------: | :----: | :--------------------: | :-------: | :-----: |
| `category` | string | The category of anime. | Yes | -- |
#### Query Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | :----------------------------: | :-------: | :-----: |
| `page` | number | The page number of the result. | No | `1` |
#### Request Sample
```javascript
// categories -> "most-favorite", "most-popular", "subbed-anime", "dubbed-anime", "recently-updated", "recently-added", "top-upcoming", "top-airing", "movie", "special", "ova", "ona", "tv", "completed"
const resp = await fetch("/api/v2/hianime/category/tv?page=2");
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
category: "TV Series Anime",
animes: [
{
id: string,
name: string,
poster: string,
duration: string,
type: string,
rating: string,
episodes: {
sub: number,
dub: number,
}
},
{...},
],
genres: ["Action", "Cars", "Adventure", ...],
top10Animes: {
today: [
{
episodes: {
sub: number,
dub: number,
},
id: string,
name: string,
poster: string,
rank: number
},
{...},
],
month: [...],
week: [...]
},
currentPage: 2,
totalPages: 100,
hasNextPage: true
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Estimated Schedules
</summary>
#### Endpoint
```sh
/api/v2/hianime/schedule?date={date}
```
#### Query Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | :---------------------------------------------------------------------: | :-------: | :-----: |
| `date` | string | The date of the desired schedule in the following format: (yyyy-mm-dd). | Yes | -- |
#### Request Sample
```javascript
const resp = await fetch("/api/v2/hianime/schedule?date=2024-06-09");
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
scheduledAnimes: [
{
id: string,
time: string, // 24 hours format
name: string,
jname: string,
airingTimestamp: number,
secondsUntilAiring: number
},
{...}
]
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Anime Episodes
</summary>
#### Endpoint
```sh
/api/v2/hianime/anime/{animeId}/episodes
```
#### Path Parameters
| Parameter | Type | Description | Required? | Default |
| :-------: | :----: | :------------------: | :-------: | :-----: |
| `animeId` | string | The unique anime id. | Yes | -- |
#### Request Sample
```javascript
const resp = await fetch("/api/v2/hianime/anime/steinsgate-3/episodes");
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
totalEpisodes: 24,
episodes: [
{
number: 1,
title: "Turning Point",
episodeId: "steinsgate-3?ep=213"
isFiller: false,
},
{...}
]
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Anime Episode Servers
</summary>
#### Endpoint
```sh
/api/v2/hianime/episode/servers?animeEpisodeId={id}
```
#### Query Parameters
| Parameter | Type | Description | Required? | Default |
| :--------------: | :----: | :--------------------------: | :-------: | :-----: |
| `animeEpisodeId` | string | The unique anime episode id. | Yes | -- |
#### Request Sample
```javascript
const resp = await fetch(
"/api/v2/hianime/episode/servers?animeEpisodeId=steinsgate-0-92?ep=2055"
);
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
episodeId: "steinsgate-0-92?ep=2055",
episodeNo: 5,
sub: [
{
serverId: 4,
serverName: "vidstreaming",
},
{...}
],
dub: [
{
serverId: 1,
serverName: "megacloud",
},
{...}
],
raw: [
{
serverId: 1,
serverName: "megacloud",
},
{...}
]
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
<details>
<summary>
### `GET` Anime Episode Streaming Links
</summary>
#### Endpoint
```sh
/api/v2/hianime/episode/sources?animeEpisodeId={id}?server={server}&category={dub || sub || raw}
```
#### Query Parameters
| Parameter | Type | Description | Required? | Default |
| :--------------: | :----: | :--------------------------------------------------: | :-------: | :------: |
| `animeEpisodeId` | string | The unique anime episode id. | Yes | -- |
| `server` | string | The name of the server. | No | `"hd-1"` |
| `category` | string | The category of the episode ('sub', 'dub' or 'raw'). | No | `"sub"` |
#### Request Sample
```javascript
const resp = await fetch(
"/api/v2/hianime/episode/sources?animeEpisodeId=steinsgate-3?ep=230&server=hd-1&category=dub"
);
const data = await resp.json();
console.log(data);
```
#### Response Schema
```javascript
{
success: true,
data: {
headers: {
Referer: string,
"User-Agent": string,
...
},
sources: [
{
url: string, // .m3u8 hls streaming file
isM3U8: boolean,
quality?: string,
},
{...}
],
subtitles: [
{
lang: "English",
url: string, // .vtt subtitle file
},
{...}
],
anilistID: number | null,
malID: number | null
}
}
```
[๐ผ Back to Top](#table-of-contents)
</details>
## <span id="development">๐จโ๐ป Development</span>
Pull requests and stars are always welcome. If you encounter any bug or want to add a new feature to this api, consider creating a new [issue](https://github.com/ghoshRitesh12/aniwatch-api/issues). If you wish to contribute to this project, read the [CONTRIBUTING.md](https://github.com/ghoshRitesh12/aniwatch-api/blob/main/CONTRIBUTING.md) file.
## <span id="contributors">โจ Contributors</span>
Thanks to the following people for keeping this project alive and relevant.
[](https://github.com/ghoshRitesh12/aniwatch-api/graphs/contributors)
## <span id="thanks">๐ค Thanks</span>
- [consumet.ts](https://github.com/consumet/consumet.ts)
- [api.consumet.org](https://github.com/consumet/api.consumet.org)
## <span id="support">๐ Support</span>
Don't forget to leave a star ๐. You can also follow me on X (Twitter) [@riteshgsh](https://x.com/riteshgsh).
## <span id="license">๐ License</span>
This project is licensed under the [MIT License](https://opensource.org/license/mit/) - see the [LICENSE](https://github.com/ghoshRitesh12/aniwatch-api/blob/main/LICENSE) file for more details.
<br/>
## <span id="star-history">๐ Star History</span>
<img
id="star-history"
src="https://starchart.cc/ghoshRitesh12/aniwatch-api.svg?variant=adaptive"
alt=""
/>
|