{
    "openapi": "3.1.1",
    "info": {
        "title": "dri.es API",
        "version": "1.0.0",
        "description": "Finds the posts, images and albums on dri.es."
    },
    "servers": [
        {
            "url": "https://dri.es",
            "description": "The site this API is served from."
        }
    ],
    "security": [],
    "paths": {
        "/api/find-albums": {
            "get": {
                "operationId": "find_albums",
                "summary": "Find albums",
                "description": "Finds albums on dri.es. It returns every match.\n\nResults come newest first. With a query, those with every word and phrase in their title come first, then the rest, each group newest first.\n\nMatching ignores case, accents and HTML tags, and different arguments combine with AND. Words in the address of a Markdown link count too: `wikipedia` also finds results that only link to Wikipedia.\n\n`query` takes words and finds results that contain every one of them, in any order, each in any of the fields it searches. Each word matches the start of a word, so a shorter word finds more forms: `agent` finds \"agents\" and \"agentic\", but `agents` does not find \"agent\". A word of 2 characters or fewer matches only a whole word: `AI` does not find \"aim\". This is word matching, not semantic search, so fewer words find more. `query` has no OR and no NOT: to find results with any of several words or phrases, make one call for each. It takes up to 10 words, counting those in phrases.\n\nWords in double quotes match as a phrase: unlike single words, they match only whole words, next to each other, in that order. Punctuation between them is ignored, so `\"open source\"` also finds \"open-source\". A query can mix phrases and words: `\"open source\" drupal` finds results with the phrase \"open source\" and the word \"drupal\".\n\nThe arguments that take a list, like `title`, take up to 10 patterns, and a result has to match one of them. In a pattern, `*` stands for any text: `Sun*` finds text that starts with \"Sun\", and `*sun*` finds \"sun\" anywhere, even inside a word. A pattern without `*` has to match the whole field, and `*` alone finds any field that is not empty. An empty field matches no pattern: use `missing` to find those.",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "required": false,
                        "description": "Words to look for in the id, title or description. The year is part of the id, so \"2019\" finds that year's albums.",
                        "schema": {
                            "type": "string",
                            "examples": [
                                "drupalcon"
                            ],
                            "title": "Query"
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "required": false,
                        "description": "Returns only albums whose id matches one of these patterns.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "drupalcon-*"
                                ]
                            },
                            "title": "Id"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "required": false,
                        "description": "Returns only albums whose title matches one of these patterns. Patterns see only a title someone gave the album, not the one made from its id.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "DrupalCon*"
                                ]
                            },
                            "title": "Title"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "required": false,
                        "description": "Returns only albums whose description matches one of these patterns.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "*hiking*"
                                ]
                            },
                            "title": "Description"
                        }
                    },
                    {
                        "name": "missing",
                        "in": "query",
                        "required": false,
                        "description": "Returns only albums where the named field is empty.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "description",
                                "title"
                            ],
                            "title": "Missing"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "How many albums matched. The matching albums.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/find_albums"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A missing or invalid argument.",
                        "content": {
                            "application/problem+json": {}
                        }
                    },
                    "default": {
                        "description": "Any other failure, such as a missing permission or an error on the server.",
                        "content": {
                            "application/problem+json": {}
                        }
                    }
                }
            }
        },
        "/api/find-images": {
            "get": {
                "operationId": "find_images",
                "summary": "Find images",
                "description": "Finds images on dri.es, or lists the images in an album. It returns up to 20 images, or every match when you give an album, and total counts every match. There is no pagination: to see more, narrow the search. To work through more than 20, such as adding alt text to images found with `missing`, fix the ones you got and call again: fixed images no longer match, so the next ones come back.\n\nResults come newest first. With a query, those with every word and phrase in their title come first, then the rest, each group newest first.\n\nMatching ignores case, accents and HTML tags, and different arguments combine with AND. Words in the address of a Markdown link count too: `wikipedia` also finds results that only link to Wikipedia.\n\n`query` takes words and finds results that contain every one of them, in any order, each in any of the fields it searches. Each word matches the start of a word, so a shorter word finds more forms: `agent` finds \"agents\" and \"agentic\", but `agents` does not find \"agent\". A word of 2 characters or fewer matches only a whole word: `AI` does not find \"aim\". This is word matching, not semantic search, so fewer words find more. `query` has no OR and no NOT: to find results with any of several words or phrases, make one call for each. It takes up to 10 words, counting those in phrases.\n\nWords in double quotes match as a phrase: unlike single words, they match only whole words, next to each other, in that order. Punctuation between them is ignored, so `\"open source\"` also finds \"open-source\". A query can mix phrases and words: `\"open source\" drupal` finds results with the phrase \"open source\" and the word \"drupal\".\n\nThe arguments that take a list, like `title`, take up to 10 patterns, and a result has to match one of them. In a pattern, `*` stands for any text: `Sun*` finds text that starts with \"Sun\", and `*sun*` finds \"sun\" anywhere, even inside a word. A pattern without `*` has to match the whole field, and `*` alone finds any field that is not empty. An empty field matches no pattern: use `missing` to find those.",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "required": false,
                        "description": "Words to look for in the id, title, caption, alt text or credit.",
                        "schema": {
                            "type": "string",
                            "examples": [
                                "sunset"
                            ],
                            "title": "Query"
                        }
                    },
                    {
                        "name": "album",
                        "in": "query",
                        "required": false,
                        "description": "The album to look in: an id from find_albums, or the album field of an image. Without an album, every album is searched.",
                        "schema": {
                            "type": "string",
                            "title": "Album"
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "required": false,
                        "description": "Returns only images whose id matches one of these patterns.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "*/sunset-*"
                                ]
                            },
                            "title": "Id"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "required": false,
                        "description": "Returns only images whose title matches one of these patterns. Patterns see only a title someone gave the image, not the one made from its id.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "Sunset*"
                                ]
                            },
                            "title": "Title"
                        }
                    },
                    {
                        "name": "caption",
                        "in": "query",
                        "required": false,
                        "description": "Returns only images whose caption matches one of these patterns.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "*Drupal*"
                                ]
                            },
                            "title": "Caption"
                        }
                    },
                    {
                        "name": "alt",
                        "in": "query",
                        "required": false,
                        "description": "Returns only images whose alt text matches one of these patterns.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "Photo of*"
                                ]
                            },
                            "title": "Alt"
                        }
                    },
                    {
                        "name": "credit",
                        "in": "query",
                        "required": false,
                        "description": "Returns only images whose credit matches one of these patterns. Images by Dries have no credit.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "*Johnson"
                                ]
                            },
                            "title": "Credit"
                        }
                    },
                    {
                        "name": "missing",
                        "in": "query",
                        "required": false,
                        "description": "Returns only images where the named field is empty.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "alt",
                                "caption",
                                "credit",
                                "title"
                            ],
                            "title": "Missing"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "How many images matched, including any not returned. The matching images.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/find_images"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A missing or invalid argument.",
                        "content": {
                            "application/problem+json": {}
                        }
                    },
                    "default": {
                        "description": "Any other failure, such as a missing permission or an error on the server.",
                        "content": {
                            "application/problem+json": {}
                        }
                    }
                }
            }
        },
        "/api/get-image": {
            "get": {
                "operationId": "get_image",
                "summary": "Get image",
                "description": "Returns one image by its id. Over MCP, the result also includes the image itself, at most 640px wide, so you can see it. Apps that can display it, like Claude, also show it to the user, so call it whenever they should see an image you're working on.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "required": true,
                        "description": "Image ids have the form \"album/name\", as find_images returns them.",
                        "schema": {
                            "type": "string",
                            "examples": [
                                "japan-2024/shibuya-crossing"
                            ],
                            "title": "Id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The image.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/get_image"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A missing or invalid argument.",
                        "content": {
                            "application/problem+json": {}
                        }
                    },
                    "default": {
                        "description": "Any other failure, such as a missing permission or an error on the server.",
                        "content": {
                            "application/problem+json": {}
                        }
                    }
                }
            }
        },
        "/api/find-posts": {
            "get": {
                "operationId": "find_posts",
                "summary": "Find posts",
                "description": "Finds posts on dri.es, Dries Buytaert's blog. It returns up to 20 posts, and total counts every match. There is no pagination: to see more, narrow the search. Append .md to a post's URL to get its full text as Markdown.\n\nResults come newest first. With a query, those with every word and phrase in their title come first, then the rest, each group newest first.\n\nMatching ignores case, accents and HTML tags, and different arguments combine with AND. Words in the address of a Markdown link count too: `wikipedia` also finds results that only link to Wikipedia.\n\n`query` takes words and finds results that contain every one of them, in any order, each in any of the fields it searches. Each word matches the start of a word, so a shorter word finds more forms: `agent` finds \"agents\" and \"agentic\", but `agents` does not find \"agent\". A word of 2 characters or fewer matches only a whole word: `AI` does not find \"aim\". This is word matching, not semantic search, so fewer words find more. `query` has no OR and no NOT: to find results with any of several words or phrases, make one call for each. It takes up to 10 words, counting those in phrases.\n\nWords in double quotes match as a phrase: unlike single words, they match only whole words, next to each other, in that order. Punctuation between them is ignored, so `\"open source\"` also finds \"open-source\". A query can mix phrases and words: `\"open source\" drupal` finds results with the phrase \"open source\" and the word \"drupal\".\n\nThe arguments that take a list, like `title`, take up to 10 patterns, and a result has to match one of them. In a pattern, `*` stands for any text: `Sun*` finds text that starts with \"Sun\", and `*sun*` finds \"sun\" anywhere, even inside a word. A pattern without `*` has to match the whole field, and `*` alone finds any field that is not empty. An empty field matches no pattern: use `missing` to find those.",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "required": false,
                        "description": "Words or phrases to look for in the title, summary or body.",
                        "schema": {
                            "type": "string",
                            "examples": [
                                "\"open source\" drupal"
                            ],
                            "title": "Query"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "required": false,
                        "description": "Returns only posts whose title matches one of these patterns.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "State of Drupal*"
                                ]
                            },
                            "title": "Title"
                        }
                    },
                    {
                        "name": "summary",
                        "in": "query",
                        "required": false,
                        "description": "Returns only posts whose summary matches one of these patterns.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "*open source*"
                                ]
                            },
                            "title": "Summary"
                        }
                    },
                    {
                        "name": "missing",
                        "in": "query",
                        "required": false,
                        "description": "Returns only posts where the named field is empty.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "summary"
                            ],
                            "title": "Missing"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "description": "Returns only posts published after this date, in UTC, as YYYY-MM-DD. Posts from that date are left out: for posts from 2025 on, use 2024-12-31.",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "title": "After"
                        }
                    },
                    {
                        "name": "before",
                        "in": "query",
                        "required": false,
                        "description": "Returns only posts published before this date, in UTC, as YYYY-MM-DD. Posts from that date are left out: for posts from before 2025, use 2025-01-01.",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "title": "Before"
                        }
                    },
                    {
                        "name": "fields",
                        "in": "query",
                        "required": false,
                        "description": "The fields to return for each post. By default, all fields are returned. Save bandwidth and tokens by requesting only what you need.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "enum": [
                                    "title",
                                    "url",
                                    "date",
                                    "snippets",
                                    "summary"
                                ]
                            },
                            "title": "Fields"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "How many posts matched, including any not returned. The matching posts.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/find_posts"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A missing or invalid argument.",
                        "content": {
                            "application/problem+json": {}
                        }
                    },
                    "default": {
                        "description": "Any other failure, such as a missing permission or an error on the server.",
                        "content": {
                            "application/problem+json": {}
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "find_albums": {
                "type": "object",
                "properties": {
                    "total": {
                        "type": "integer",
                        "description": "How many albums matched.",
                        "title": "Total"
                    },
                    "results": {
                        "type": "array",
                        "description": "The matching albums.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "description": "Also the prefix of every image id in the album.",
                                    "title": "Id"
                                },
                                "title": {
                                    "type": "string",
                                    "description": "The album's display name.",
                                    "title": "Title"
                                },
                                "url": {
                                    "type": "string",
                                    "format": "uri",
                                    "description": "Absolute URL to the album's page.",
                                    "title": "Url"
                                },
                                "year": {
                                    "oneOf": [
                                        {
                                            "type": "integer"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ],
                                    "minimum": 1900,
                                    "maximum": 2099,
                                    "description": "The year the album is from.",
                                    "title": "Year"
                                },
                                "description": {
                                    "type": "string",
                                    "contentMediaType": "text/markdown",
                                    "description": "Shown inside a paragraph at the top of the album page, as inline Markdown such as a link or emphasis. It is as written, so sanitize the HTML you convert it to.",
                                    "title": "Description"
                                }
                            },
                            "required": [
                                "id",
                                "title",
                                "url",
                                "year",
                                "description"
                            ]
                        },
                        "title": "Results"
                    }
                },
                "required": [
                    "total",
                    "results"
                ]
            },
            "find_images": {
                "type": "object",
                "properties": {
                    "total": {
                        "type": "integer",
                        "description": "How many images matched, including any not returned.",
                        "title": "Total"
                    },
                    "results": {
                        "type": "array",
                        "description": "The matching images.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "description": "The album's id, a slash, then the image's name.",
                                    "title": "Id"
                                },
                                "title": {
                                    "type": "string",
                                    "description": "The image's display name.",
                                    "title": "Title"
                                },
                                "url": {
                                    "type": "string",
                                    "format": "uri",
                                    "description": "Absolute URL to the image's page.",
                                    "title": "Url"
                                },
                                "album": {
                                    "type": "string",
                                    "description": "The id of the album the image is in, as find_albums returns it.",
                                    "title": "Album"
                                },
                                "thumbnail": {
                                    "type": "string",
                                    "format": "uri",
                                    "description": "Absolute URL to a variant at most 640px wide, for showing the image.",
                                    "title": "Thumbnail"
                                },
                                "alt": {
                                    "type": "string",
                                    "contentMediaType": "text/plain",
                                    "description": "Plain text describing the image for screen readers.",
                                    "title": "Alt"
                                },
                                "caption": {
                                    "type": "string",
                                    "contentMediaType": "text/markdown",
                                    "description": "Shown under the image, as inline Markdown such as a link or emphasis. It is as written, so sanitize the HTML you convert it to.",
                                    "title": "Caption"
                                },
                                "credit": {
                                    "type": "string",
                                    "contentMediaType": "text/plain",
                                    "description": "Who to credit for the image. Images by Dries have none.",
                                    "title": "Credit"
                                },
                                "month": {
                                    "type": "string",
                                    "description": "The year and month the image was taken, as YYYY-MM.",
                                    "title": "Month"
                                },
                                "posts": {
                                    "type": "array",
                                    "description": "Absolute URLs of the published posts that embed this image, link to it or use it as their lead image. Append .md to a URL to see how the post uses it.",
                                    "items": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "title": "Posts"
                                }
                            },
                            "required": [
                                "id",
                                "title",
                                "url",
                                "album",
                                "thumbnail",
                                "alt",
                                "caption",
                                "credit",
                                "month",
                                "posts"
                            ]
                        },
                        "title": "Results"
                    }
                },
                "required": [
                    "total",
                    "results"
                ]
            },
            "get_image": {
                "type": "object",
                "properties": {
                    "image": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "description": "The album's id, a slash, then the image's name.",
                                "title": "Id"
                            },
                            "title": {
                                "type": "string",
                                "description": "The image's display name.",
                                "title": "Title"
                            },
                            "url": {
                                "type": "string",
                                "format": "uri",
                                "description": "Absolute URL to the image's page.",
                                "title": "Url"
                            },
                            "album": {
                                "type": "string",
                                "description": "The id of the album the image is in, as find_albums returns it.",
                                "title": "Album"
                            },
                            "thumbnail": {
                                "type": "string",
                                "format": "uri",
                                "description": "Absolute URL to a variant at most 640px wide, for showing the image.",
                                "title": "Thumbnail"
                            },
                            "alt": {
                                "type": "string",
                                "contentMediaType": "text/plain",
                                "description": "Plain text describing the image for screen readers.",
                                "title": "Alt"
                            },
                            "caption": {
                                "type": "string",
                                "contentMediaType": "text/markdown",
                                "description": "Shown under the image, as inline Markdown such as a link or emphasis. It is as written, so sanitize the HTML you convert it to.",
                                "title": "Caption"
                            },
                            "credit": {
                                "type": "string",
                                "contentMediaType": "text/plain",
                                "description": "Who to credit for the image. Images by Dries have none.",
                                "title": "Credit"
                            },
                            "month": {
                                "type": "string",
                                "description": "The year and month the image was taken, as YYYY-MM.",
                                "title": "Month"
                            },
                            "posts": {
                                "type": "array",
                                "description": "Absolute URLs of the published posts that embed this image, link to it or use it as their lead image. Append .md to a URL to see how the post uses it.",
                                "items": {
                                    "type": "string",
                                    "format": "uri"
                                },
                                "title": "Posts"
                            }
                        },
                        "required": [
                            "id",
                            "title",
                            "url",
                            "album",
                            "thumbnail",
                            "alt",
                            "caption",
                            "credit",
                            "month",
                            "posts"
                        ],
                        "description": "The image.",
                        "title": "Image"
                    }
                },
                "required": [
                    "image"
                ]
            },
            "find_posts": {
                "type": "object",
                "properties": {
                    "total": {
                        "type": "integer",
                        "description": "How many posts matched, including any not returned.",
                        "title": "Total"
                    },
                    "results": {
                        "type": "array",
                        "description": "The matching posts.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "title": {
                                    "type": "string",
                                    "description": "The post's title.",
                                    "title": "Title"
                                },
                                "url": {
                                    "type": "string",
                                    "format": "uri",
                                    "description": "Absolute URL to the post's page.",
                                    "title": "Url"
                                },
                                "date": {
                                    "type": "string",
                                    "format": "date",
                                    "description": "The date the post was published, in UTC, as YYYY-MM-DD.",
                                    "title": "Date"
                                },
                                "snippets": {
                                    "type": "array",
                                    "description": "Complete paragraphs, list items or headings from the post's body, as Markdown, each holding at least one of the query's words or phrases: at most three, those holding the most, in document order but not always adjacent. Empty when none holds them, as when they appear only in the title, the summary, code, a table or an image's file name.",
                                    "items": {
                                        "type": "string"
                                    },
                                    "title": "Snippets"
                                },
                                "summary": {
                                    "type": "string",
                                    "description": "A short summary of the post.",
                                    "title": "Summary"
                                }
                            }
                        },
                        "title": "Results"
                    }
                },
                "required": [
                    "total",
                    "results"
                ]
            }
        }
    }
}