Skip to content

APIs

The subsection converter is actually an API. And to support proxy-provider, I implemented another API.
Here I'm gonna introduce the APIs.

GET /sub

This is the API for subsection converter. It's contained in the link generated by the web ui.
It accepts GET requests. Here're the parameters:

ParameterDescriptionOptionalDefaultRemarks
urlThe URL of the original subscription or node sharing link. It needs to be URIComponent encoded.No-Multiple subscription links are supported. You can use line breaks or "|" to separate them. https://t.me/... links are treated as standalone share links (parsed as V2Ray nodes), not as remote subscription URLs.
templateTemplate ID used to render the final config.YeszjuBuilt-in values are zju and general. When omitted, zju is used.
intervalThe interval of proxy update.Yes1800Unit: seconds.
urlstandbyThe URL of the standby subscription or node sharing link. The proxies in it will only be added to the manual switch group (the group whose "manual" is True in the configuration file), and will not be classified into region groups. It's recommended to be URIComponent encoded.Yes-Multiple subscription links are supported. You can use line breaks or "
shortIf this parameter is set (regardless of its value), the header section and dns section containing allow-lan will not be generated.Yes--
nprIf this parameter is set (regardless of its value), the URL of the ruleset will not be proxied.Yes-By default, this service is used to proxy the URL of the ruleset to ensure that the ruleset can be obtained normally. If this parameter is set, the URL of the ruleset will not be proxied.

GET /provider

This API converts the subscription to the configuration required by proxy-provider. This API will be called whenever the proxy is updated via proxy-provider.

It accepts GET requests. Here're the parameters:

ParameterDescriptionOptionalDefaultRemarks
urlThe URL of the original subscription. It needs to be URIComponent encoded.No-Should be a single subscription link.

GET /config

This API returns the runtime configuration used by the Web UI. It accepts GET requests and takes no parameters.

Response JSON fields:

FieldDescription
defaultTemplateThe template name used when /sub or /proxy omits the template query parameter (from DEFAULT_TEMPLATE in config.yaml).
availableTemplatesA list of all template names found in the template/ directory.

GET /robots.txt

Returns a robots.txt response based on the DISALLOW_ROBOTS setting in config.yaml. When DISALLOW_ROBOTS=true, it returns User-agent: * / Disallow: /; otherwise it returns 404.

GET /proxy

This API is used to access the specified URL through this service. It accepts GET requests. Here're the parameters:

ParameterDescriptionOptionalDefaultRemarks
urlThe URL to be proxied. It needs to be URIComponent encoded.No-Use this service to access this URL and return the result.
templateTemplate ID used for rule whitelist validation.YeszjuThis should match the template used in /sub; the generated config already includes it when needed.

Released under the MPL-2.0 License.