{"openapi":"3.1.0","info":{"title":"API de Adjudico.es","version":"1.0.0","summary":"Lectura de adjudicaciones, vencimientos, licitaciones abiertas y encajes para consultoras.","description":"Datos oficiales de la Plataforma de Contratación del Sector Público (Ministerio de Hacienda) tal como los muestra Adjudico.es. Autenticación con una clave de API (`Authorization: Bearer adj_…`) creada en tu cuenta (planes Consultora y Grupo). Cupo diario por organización: 10.000 peticiones en Consultora y 100.000 en Grupo (el contador vuelve a cero a medianoche, hora de Madrid); además, 60 peticiones por minuto por clave. Las fechas de fin son estimaciones salvo `end.basis = planned_end`. Sin CORS: la API se llama de servidor a servidor.","contact":{"name":"Adjudico.es","url":"https://adjudico.es/contacto"}},"servers":[{"url":"https://adjudico.es/api/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"companies","description":"Permiso read:companies"},{"name":"tenders","description":"Permiso read:tenders: licitaciones abiertas, anuncios previos y órganos de contratación"},{"name":"fits","description":"Permiso read:fits"}],"paths":{"/public-api/companies/{nif}":{"get":{"operationId":"getCompany","tags":["companies"],"summary":"Resumen público de una empresa","description":"Adjudicaciones de los últimos 5 años, actividades (CPV), zonas y organismos principales. Solo personas jurídicas. Permiso read:companies.","x-required-scope":"read:companies","parameters":[{"$ref":"#/components/parameters/Nif"}],"responses":{"200":{"description":"La empresa","content":{"application/json":{"schema":{"type":"object","required":["data","as_of","source"],"properties":{"data":{"$ref":"#/components/schemas/Company"},"as_of":{"type":"string","format":"date"},"source":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/public-api/companies/{nif}/contracts":{"get":{"operationId":"listCompanyContracts","tags":["companies"],"summary":"Contratos de la empresa","description":"Las 25 adjudicaciones más recientes y cada contrato de servicios o suministros que termina en 12 meses, de la adjudicación más reciente a la más antigua. Permiso read:companies.","x-required-scope":"read:companies","parameters":[{"$ref":"#/components/parameters/Nif"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Una página de contratos","headers":{"Link":{"$ref":"#/components/headers/Link"},"X-RateLimit-Limit-Day":{"$ref":"#/components/headers/LimitDay"},"X-RateLimit-Remaining-Day":{"$ref":"#/components/headers/RemainingDay"}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor","as_of","source"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contract"}},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; null on the last page."},"as_of":{"type":"string","format":"date"},"source":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/public-api/companies/{nif}/expiries":{"get":{"operationId":"listCompanyExpiries","tags":["companies"],"summary":"Contratos que vencen en 12 meses","description":"Servicios y suministros de 6 meses o más cuyo fin cae en los próximos 12 meses, del más próximo al más lejano, con la cadencia del organismo cuando es regular. Permiso read:companies.","x-required-scope":"read:companies","parameters":[{"$ref":"#/components/parameters/Nif"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Una página de vencimientos","headers":{"Link":{"$ref":"#/components/headers/Link"},"X-RateLimit-Limit-Day":{"$ref":"#/components/headers/LimitDay"},"X-RateLimit-Remaining-Day":{"$ref":"#/components/headers/RemainingDay"}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor","as_of","source"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contract"}},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; null on the last page."},"as_of":{"type":"string","format":"date"},"source":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/public-api/tenders":{"get":{"operationId":"listOpenTenders","tags":["tenders"],"summary":"Licitaciones abiertas por CPV y zona","description":"Licitaciones con plazo abierto, de la que cierra antes a la que cierra después. Sin filtros, todas. Permiso read:tenders.","x-required-scope":"read:tenders","parameters":[{"name":"cpv","in":"query","description":"Hasta 5 códigos CPV o prefijos (2 a 8 cifras), separados por comas.","schema":{"type":"string","examples":["90911,45233"]}},{"name":"region","in":"query","description":"Hasta 5 códigos NUTS de España (ES, ES5, ES51, ES511…), separados por comas.","schema":{"type":"string","examples":["ES51,ES30"]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Una página de licitaciones abiertas","headers":{"Link":{"$ref":"#/components/headers/Link"},"X-RateLimit-Limit-Day":{"$ref":"#/components/headers/LimitDay"},"X-RateLimit-Remaining-Day":{"$ref":"#/components/headers/RemainingDay"}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor","as_of","source"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Tender"}},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; null on the last page."},"as_of":{"type":"string","format":"date"},"source":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/public-api/prior-notices":{"get":{"operationId":"listPriorNotices","tags":["tenders"],"summary":"Se prepara: anuncios de información previa","description":"Contratos que un órgano ha anunciado con un anuncio de información previa (art. 134 LCSP) y aún no ha licitado, del actualizado más recientemente al más antiguo. El anuncio es un dato oficial; `expected_tender_by` es una previsión (fecha del anuncio más 12 meses) y la licitación puede no llegar. Una página puede traer menos elementos que `limit` aunque haya más. Permiso read:tenders.","x-required-scope":"read:tenders","parameters":[{"name":"cpv","in":"query","description":"Hasta 5 códigos CPV o prefijos (2 a 8 cifras), separados por comas.","schema":{"type":"string","examples":["90911,45233"]}},{"name":"region","in":"query","description":"Hasta 5 códigos NUTS de España, separados por comas. Un anuncio sin lugar publicado se incluye.","schema":{"type":"string","examples":["ES51,ES30"]}},{"name":"buyer","in":"query","description":"NIF de un órgano de contratación.","schema":{"type":"string","examples":["S3333001J"]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Una página de anuncios previos","headers":{"Link":{"$ref":"#/components/headers/Link"},"X-RateLimit-Limit-Day":{"$ref":"#/components/headers/LimitDay"},"X-RateLimit-Remaining-Day":{"$ref":"#/components/headers/RemainingDay"}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor","as_of","source"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PriorNotice"}},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; null on the last page."},"as_of":{"type":"string","format":"date"},"source":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/public-api/buyers/{nif}":{"get":{"operationId":"getBuyer","tags":["tenders"],"summary":"Resumen de un órgano de contratación","description":"Qué compra y con qué cadencia, quién gana, con qué baja adjudica, qué tiene abierto, qué contratos de sus adjudicatarios vencen y qué anuncios previos tiene publicados. Permiso read:tenders.","x-required-scope":"read:tenders","parameters":[{"$ref":"#/components/parameters/Nif"}],"responses":{"200":{"description":"El órgano","content":{"application/json":{"schema":{"type":"object","required":["data","as_of","source"],"properties":{"data":{"$ref":"#/components/schemas/Buyer"},"as_of":{"type":"string","format":"date"},"source":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/public-api/fits":{"get":{"operationId":"listFits","tags":["fits"],"summary":"Licitaciones que encajan con un perfil guardado","description":"Con el perfil de tu cuenta (CIF, actividades, zonas, palabras clave) o, con `client`, con el de un cliente de tu consultora. Publicadas o actualizadas en los últimos 90 días, de mayor a menor encaje. Permiso read:fits.","x-required-scope":"read:fits","parameters":[{"name":"client","in":"query","description":"CIF de un cliente de tu consultora.","schema":{"type":"string","examples":["B12345674"]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Una página de encajes","headers":{"Link":{"$ref":"#/components/headers/Link"},"X-RateLimit-Limit-Day":{"$ref":"#/components/headers/LimitDay"},"X-RateLimit-Remaining-Day":{"$ref":"#/components/headers/RemainingDay"}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor","as_of","source"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Fit"}},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; null on the last page."},"as_of":{"type":"string","format":"date"},"source":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"adj_<prefijo>_<secreto>","description":"Clave creada en Mi cuenta › API. Se muestra una sola vez; guardamos solo su huella SHA-256."}},"headers":{"Link":{"description":"RFC 8288: `<…?cursor=…>; rel=\"next\"` when there is a next page.","schema":{"type":"string"}},"LimitDay":{"description":"Calls this key may make today.","schema":{"type":"integer"}},"RemainingDay":{"description":"Calls left today for this key.","schema":{"type":"integer"}}},"parameters":{"Nif":{"name":"nif","in":"path","required":true,"description":"NIF de una sociedad o entidad (no de personas físicas).","schema":{"type":"string","examples":["B12345674"]}},"Limit":{"name":"limit","in":"query","description":"Elementos por página (1 a 200, por defecto 50).","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},"Cursor":{"name":"cursor","in":"query","description":"El `next_cursor` de la página anterior.","schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"Parámetro no válido","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Unauthorized":{"description":"Falta la clave, no es válida o está revocada","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Forbidden":{"description":"La clave no tiene el permiso (`forbidden`) o el plan ya no incluye la API (`plan_limit`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"NotFound":{"description":"No consta","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"TooManyRequests":{"description":"Límite por minuto o diario de la clave","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"schemas":{"Claims":{"type":"object","description":"Clase de cada dato del elemento: OFFICIAL_FACT (lo publica la Administración), DERIVED_VALUE (cálculo con regla publicada), FORECAST (estimación con su base), SYSTEM_OBSERVATION (lo que nuestro sistema encontró, o no, a una fecha), USER_CONFIRMATION (lo declaró la empresa).","additionalProperties":{"type":"string","enum":["OFFICIAL_FACT","DERIVED_VALUE","FORECAST","SYSTEM_OBSERVATION","USER_CONFIRMATION"]}},"Problem":{"type":"object","description":"RFC 9457 problem details.","required":["type","title","status","code","trace_id"],"properties":{"type":{"type":"string","examples":["urn:radar:error:unauthenticated"]},"title":{"type":"string"},"status":{"type":"integer"},"code":{"type":"string","enum":["validation","not_found","rate_limited","internal","unauthenticated","forbidden","plan_limit","conflict","too_large","unavailable"]},"trace_id":{"type":"string"},"detail":{"type":"string"}}},"Party":{"type":"object","required":["nif","name"],"properties":{"nif":{"type":["string","null"]},"name":{"type":["string","null"]}}},"Company":{"type":"object","required":["nif","name","award_count","total_awarded_ex","activities","regions","top_buyers","report_url"],"properties":{"nif":{"type":"string"},"name":{"type":["string","null"]},"award_count":{"type":"integer"},"total_awarded_ex":{"type":"number"},"median_award_ex":{"type":["number","null"]},"first_award":{"type":["string","null"],"format":"date"},"last_award":{"type":["string","null"],"format":"date"},"expiring_12_months":{"type":"integer"},"activities":{"type":"array","items":{"type":"object","properties":{"cpv_prefix":{"type":"string"},"awards":{"type":"integer"},"total_ex":{"type":"number"}}}},"regions":{"type":"array","items":{"type":"object","properties":{"nuts2":{"type":"string"},"awards":{"type":"integer"}}}},"top_buyers":{"type":"array","items":{"type":"object","properties":{"nif":{"type":"string"},"name":{"type":["string","null"]},"awards":{"type":"integer"},"total_ex":{"type":"number"}}}},"report_url":{"type":"string","format":"uri"},"source_url":{"type":"string","format":"uri"},"claims":{"$ref":"#/components/schemas/Claims"}}},"Contract":{"type":"object","required":["tender_id","title","buyer","end","source_url"],"properties":{"tender_id":{"type":"string","description":"Official folder id (an absolute URL)."},"title":{"type":["string","null"]},"buyer":{"$ref":"#/components/schemas/Party"},"cpv":{"type":["string","null"]},"nuts":{"type":["string","null"]},"award_date":{"type":["string","null"],"format":"date"},"amount_ex":{"type":["number","null"]},"offers":{"type":["integer","null"]},"end":{"type":"object","required":["date","basis","is_estimate"],"properties":{"date":{"type":["string","null"],"format":"date"},"basis":{"type":["string","null"],"enum":["planned_end","start+duration","formalized+duration","published+duration","award+duration",null]},"is_estimate":{"type":"boolean"},"with_extensions":{"type":["string","null"],"format":"date"},"extensions_basis":{"type":["string","null"],"enum":["extension_measure","extension_text",null]}}},"recurrence":{"type":["object","null"],"properties":{"median_gap_months":{"type":"number"},"last_award_month":{"type":"string"},"next_window":{"type":"array","items":{"type":"string","format":"date"}},"signal":{"type":"string","enum":["alta","media","baja"]}}},"holder":{"$ref":"#/components/schemas/Party"},"source_url":{"type":["string","null"],"format":"uri"},"claims":{"$ref":"#/components/schemas/Claims"}}},"Tender":{"type":"object","required":["tender_id","title","buyer","deadline","source_url"],"properties":{"tender_id":{"type":"string"},"title":{"type":["string","null"]},"buyer":{"$ref":"#/components/schemas/Party"},"cpv":{"type":["string","null"]},"nuts":{"type":["string","null"]},"budget_ex":{"type":["number","null"]},"deadline":{"type":"string"},"decision_url":{"type":"string","format":"uri"},"source_url":{"type":["string","null"],"format":"uri"},"claims":{"$ref":"#/components/schemas/Claims"}}},"Fit":{"type":"object","required":["tender_id","score","tier","reasons","source_url"],"properties":{"tender_id":{"type":"string"},"title":{"type":["string","null"]},"buyer_name":{"type":["string","null"]},"nuts":{"type":["string","null"]},"budget_ex":{"type":["number","null"]},"deadline":{"type":["string","null"]},"score":{"type":"integer"},"tier":{"type":"string","enum":["alta","media","baja"]},"reasons":{"type":"array","items":{"type":"string"}},"decision_url":{"type":"string","format":"uri"},"source_url":{"type":["string","null"],"format":"uri"},"claims":{"$ref":"#/components/schemas/Claims"}}},"PriorNotice":{"type":"object","required":["tender_id","title","buyer","notice","expected_tender_by","expected_basis","source_url","claims"],"properties":{"tender_id":{"type":"string"},"title":{"type":["string","null"]},"buyer":{"$ref":"#/components/schemas/Party"},"cpvs":{"type":"array","items":{"type":"string"}},"nuts":{"type":["string","null"]},"budget_ex":{"type":["number","null"]},"duration_months":{"type":["number","null"]},"notice":{"type":"object","required":["code","label","published_on"],"properties":{"code":{"type":"string","enum":["DOC_PIN","DOC_PIN_RTL"]},"label":{"type":"string"},"published_on":{"type":["string","null"],"format":"date"}}},"expected_tender_by":{"type":["string","null"],"format":"date","description":"Previsión: fecha del anuncio más 12 meses (art. 134 LCSP)."},"expected_basis":{"type":"string"},"source_url":{"type":["string","null"],"format":"uri"},"claims":{"$ref":"#/components/schemas/Claims"}}},"Buyer":{"type":"object","required":["nif","name","totals","preparing","page_url","claims"],"properties":{"nif":{"type":"string"},"name":{"type":["string","null"]},"window":{"type":"object","properties":{"from":{"type":["string","null"],"format":"date"},"history_cutoff":{"type":["string","null"],"format":"date"}}},"totals":{"type":"object","properties":{"award_count":{"type":"integer"},"total_awarded_ex":{"type":"number"},"winners":{"type":"integer"},"last_award":{"type":["string","null"],"format":"date"},"active_activities_12_months":{"type":"integer"}}},"activities":{"type":"array","items":{"type":"object","properties":{"cpv_group":{"type":"string"},"label":{"type":"string"},"awards":{"type":"integer"},"total_ex":{"type":"number"},"median_gap_months":{"type":["number","null"]}}}},"winners":{"type":"array","items":{"type":"object","properties":{"nif":{"type":"string"},"name":{"type":["string","null"]},"wins":{"type":"integer"},"total_ex":{"type":"number"},"last_win":{"type":["string","null"],"format":"date"}}}},"discount":{"type":["object","null"],"properties":{"sample":{"type":"integer"},"p25":{"type":"number"},"median":{"type":"number"},"p75":{"type":"number"},"median_offers":{"type":["number","null"]}}},"open_tenders":{"type":"array","items":{"$ref":"#/components/schemas/Tender"}},"expiring":{"type":"array","items":{"$ref":"#/components/schemas/Contract"}},"preparing":{"type":"array","items":{"$ref":"#/components/schemas/PriorNotice"}},"page_url":{"type":"string","format":"uri"},"source_url":{"type":"string","format":"uri"},"claims":{"$ref":"#/components/schemas/Claims"}}}}}}